Fix metadata on undoing remove