Fixed the test_query tests