Patches to sorting.