Fix buggy Class#constants for Object (fixes #304)