Put back the sort to last array element fix.