bugfix for query.count
fix test_basic_query