Bugfix for quicksort