fix zero padding in SegmentTemplate. Fully fixes issue #32