Bug fix in deepCopy for cloning DOM nodes