Restoring state.