fixes segment generation for SegmentTemplate