Fixed a bug which moved DOM nodes from the function parameters (now they get copied, so the parameter stays intact)