Pagination count() query should remove ORDER BY clause(s)

Fixes bug #100