 
             // Remove the token
             do {
-                try keychain.deletePersistentToken(keychainItem)
+                try keychain.deletePersistentToken(savedToken)
             } catch {
                 XCTFail("deletePersistentToken(_:) failed with error: \(error)")
                 return

            // Modify the token
            let modifiedToken = Token(name: "???", issuer: "!", generator: token.generator.successor())
            do {
                let modifiedKeychainItem = try keychain.updatePersistentToken(keychainItem,
                    withToken: modifiedToken)
                XCTAssertEqual(modifiedKeychainItem.identifier, keychainItem.identifier)
                XCTAssertEqual(modifiedKeychainItem.token, modifiedToken)
            } catch {
                XCTFail("updatePersistentToken(_:withToken:) failed with error: \(error)")


        do {
            // Save the token
            let savedToken = try keychain.addToken(token)

            // Restore the token
            do {
                guard let secondKeychainItem = try keychain.persistentTokenWithIdentifier(savedToken.identifier) else {
                    XCTFail("Failed to recover persistent token with identifier: \(savedToken.identifier)")
                    return
                }
                XCTAssertEqual(secondKeychainItem, savedToken)
            } catch {
                XCTFail("persistentTokenWithIdentifier(_:) failed with error: \(error)")
                return
