Improve sorter_rank behavior