Fixed bug with incorrect root node detection if node with the same name exists elsewhere in the tree