Fix query(string) regression

introduced in #1301
Merge pull request #1331 from jmonster/qs-regression

Fix query(string) regression