fix Segment.GetValue indexing bug