Fixed flatten tree, not implemented with objects