Fix twopi to allow root as a node attribute, and allow multiple usages
in order to specify the roots of separate components.