Fixed minor bug in QueryHelper