Fix testing failure for invalid query inputs