For some very arcane reasons you need to call truncate_ranges before using one of the range iterators.
The high level functions in io do this, but if you want to use the tree itself you need to do it yourself. But currently the fn is not even exposed.
Either expose it, or make exposing it unnecessary.