fixed code for v1.9 and modified a test for the issue

Class.new.name should return nil