Reconstruct the delete node function, fix delete bug.