Add "size" field for segments and fix the bug