Fixed AnyObjectFactory bug which caused problems on creating instances o...

...f classes which were defined in Scala objects