Fix wrong assignment inside ObjectFactory's constructor