Compares were not counted correctly.
Fixed an infinite loop in balanced quicksort.