Use define_method when method name contains weird characters.
Merge pull request #9274 from KrzysiekJ/spaces_in_scope_names

Use define_method when method name contains weird characters.
Fix syntax error