Improving query structure. Adding more tests for count query serialization.