Fixed a concurrent modification issue.

We need to be cautious when traversing and modifying our trees.