small fixes to merge sort