Fix error when using class name and/or class with method