bugfix: nesting arrays causing TypeError 2007

Factory.collapse being called at the wrong place