Fixing a rerooting bug