small fixes to quicksort