Saving and loading for terminal nodes