Fix for Issue#308 - Added new test case for queries