Workaround for bug when the root node of a tree is removed from the page