We're relying on the third party library jquery.acitree for tree operations.
Yes, what I was suggesting is to probably move away from that. AciTree is one of the libraries my team identified as questionable (not in major repositories, not actively maintained) and there are lots of alternatives.
That said, I took a peek at the code and noticed that it was using a global variable ('d') inside the loop where it calculated the tree hierarchy. I suspect that is not the only issue, but here is a patch for it.
Tira