Fixed lockout error due to infinite loop in quick sort.