Fix picking latest orders when orders are not sorted