Minor fix to query code to not break on unrecognized queries