Fixed un-thrown exceptions in object factory.