Instead of recalculating it from scratch (which was more robust, I admit), just grab the information from the tree.