Fixed merge sort indexing bug