Fixed issue with test_query