Fixed small bugs in DSelect and QuickSort