many bugfixes, test now runs without errors, but hierarchy is broken (root has no children)