Fixing bug when removing previously added nodes.