Minor fixes. If action is invoked in wrong place (for instance, inside another method), the new method is created inside the class, anyway.