Fix double free when saving.