One more fix about custom query grammar
Merge branch 'fix_custom_grammar' into master-with-fixes