Fix a wrong logical for AddFuncMap method.