Instead of trying to deep-copy the entire stats tree, which sometimes causes really weird errors, just copy anything that looks like a dict into an actual dict.