Fix linked list sort