One more fix about custom query grammar