Fix factory errors