Fixed various things in the quick sort