Arbor: fix exception in findBranchAndEndNodes

When selecting an arbor with no children, an exception was thrown due to
a change in fadf4c936142534380ded17110c5d26dfb9730ab referring to root
in the wrong scope. This exception froze the overlay.