Make the merge procedure stable