#288 Solved erratic bug when root node is replaced by child