Fixed insertion of incorrect nodes.