Added protection from stack overflow in QuickSort (recursion continues only in a smaller part).