Remove redundancy in onQuery item selection criteria.

Fixes issue #2.