Removed uneccesary copying of nodes.