Fix handling of messages with repeating segments.