Fix worst case of quick sort