collectObjects now correctly passes the query object.