Repaired QSort

There was a non-trivial bug, duplicate numbers are not sorted.