Fixed some bugs in ImageSegmentor