Fixed factory bug.