Newest fixes on sorting algorithms