* Fixed pagination for queries involving server-side sorting