Bugfix if root has only outgoing edges