Fixed getSegmentCount