Add tests to detect the error.
Assign the correct tree id to root nodes.
Merge pull request #25 from GaretJax/23-tree_id

Set the correct tree ID for root nodes