Fixed behavior on multiple merges after sorting