Added test cases for invalid and incompatible queries