Improvement to SegmentTemplate handling.