Correctly find root node, even when it has a different index from 1