Fix incorrect order by