Fix class and method scope
Fix tests