CONTRIB-5465: Sorting by time then position