Fix query.
Query class update and new collection tests.