Fix visualization and saving the tree