Fix grammarMap check