Fixed wrong count on paginated queries that use collecitons in non select clauses