Added unit tests for Query class
Minor changes