Improve query coverage.

Improves coverage of query manipulation. Coverage after this change, as measured by istanbul:

Statements   : 95.98% ( 167/174 )
Branches     : 93.04% ( 107/115 )
Functions    : 91.67% ( 22/24 )
Lines        : 95.98% ( 167/174 )