Fix and integer overflow issue in SDK's QuickSort