fix compile errors in Segment.WriteTo