Fixed bug in location of check for null query info