Add testing for invalid queries