deal correctly with invalid sub-segments