Bugfix: Make sure sub-frames are not modified

Create clones of subtrees before adding them to the result in framing operations.