Fixed bug where queryState=false caused error.

In particular when queryState=false then we get an uncaught TypeError:
boolean is not a function.
Merge pull request #179 from acornejo/master

Fixed bug where queryState=false caused error.