Saving of state.