Fix bad logic for merging versions at the segment level