Correct lost sort order detection in merge