- fixed: error if the root of a calculated subtree is one of the idrefs itself (idref is on the path of the other idref to global root)
 - in calculateHead: if node has just one child --> take it as root without checking headRules