Fixed selectionSort()