Fix a bug in segment_phase.c