Merge pull request #28 from briandeheus/develop

Improved query checking