Fixed a bug when removing current node.