Another attempt at fixing the QueryChooser Coverity defect.
* Ryan and I have tried several potential solutions. This one *appears* correct, but we'll see what Coverity thinks.