         }
 
 
-        XCTAssertEqual(secondToken.type, OTPTokenType.Timer);
-        XCTAssertEqual(secondToken.name, "Léon");
-        XCTAssertEqual(secondToken.algorithm, OTPAlgorithm.SHA256);
-        XCTAssertTrue(abs(secondToken.period - 45.0) < DBL_EPSILON);
-        XCTAssertEqual(secondToken.digits, 8);
+        XCTAssertEqual(secondToken.type, OTPTokenType.Timer)
+        XCTAssertEqual(secondToken.name, "Léon")
+        XCTAssertEqual(secondToken.algorithm, OTPAlgorithm.SHA256)
+        XCTAssertEqualWithAccuracy(secondToken.period, 45, accuracy: DBL_EPSILON)
+        XCTAssertEqual(secondToken.digits, 8)
 
         XCTAssertEqual(secondToken.secret, NSData(bytes: kValidSecret, length: kValidSecret.count))
 
-        XCTAssertEqual(secondToken.keychainItemRef, token.keychainItemRef);
-        XCTAssertTrue(secondToken.isInKeychain);
+        XCTAssertEqual(secondToken.keychainItemRef, token.keychainItemRef)
+        XCTAssertTrue(secondToken.isInKeychain)
 
         // Modify the token
-        token.type = OTPTokenType.Counter;
-        token.name = "???";
-        token.digits = 6;
-
-        XCTAssertTrue(token.saveToKeychain());
+        token.type = OTPTokenType.Counter
+        token.name = "???"
+        token.digits = 6
+
+        XCTAssertTrue(token.saveToKeychain())
 
         // Fetch the token again
         guard let thirdToken = OTPToken.tokenWithKeychainItemRef(keychainItemRef) else {

                return
        }

        XCTAssertFalse(token1.isInKeychain, "Token should not be in keychain: \(token1)");
        XCTAssertFalse(token2.isInKeychain, "Token should not be in keychain: \(token2)");

        XCTAssertTrue(token1.saveToKeychain(), "Failed to save to keychain: \(token1)");

        XCTAssertTrue(token1.isInKeychain, "Token should be in keychain: \(token1)");
        XCTAssertFalse(token2.isInKeychain, "Token should not be in keychain: \(token2)");

        XCTAssertTrue(token2.saveToKeychain(), "Failed to save to keychain: \(token2)");

        XCTAssertTrue(token1.isInKeychain, "Token should be in keychain: \(token1)");
        XCTAssertTrue(token2.isInKeychain, "Token should be in keychain: \(token2)");

        XCTAssertTrue(token1.removeFromKeychain(), "Failed to remove from keychain: \(token1)");

        XCTAssertFalse(token1.isInKeychain, "Token should not be in keychain: \(token1)");
        XCTAssertTrue(token2.isInKeychain, "Token should be in keychain: \(token2)");

        XCTAssertTrue(token2.removeFromKeychain(), "Failed to remove from keychain: \(token2)");

        XCTAssertFalse(token1.isInKeychain, "Token should not be in keychain: \(token1)");
        XCTAssertFalse(token2.isInKeychain, "Token should not be in keychain: \(token2)");

        XCTAssertFalse(token1.removeFromKeychain(), "Removing again should fail: \(token1)");
        XCTAssertFalse(token2.removeFromKeychain(), "Removing again should fail: \(token2)");
    }

    func _tokenFromArray(tokens: [OTPToken], withKeychainItemRef keychainItemRef: NSData) -> OTPToken? {
        XCTAssertNotNil(tokens, "Can't find a token in a nil array.");
        XCTAssertNotNil(keychainItemRef, "Can't find a token with a nil keychain ref.");

        var foundToken: OTPToken? = nil;
        for token in tokens {
            if foundToken != nil {
                XCTAssertNotEqual(token.keychainItemRef, keychainItemRef, "Found two tokens with identical keychain refs!\n\(foundToken)\n\(token)");
            }
            if let tokenRef = token.keychainItemRef
                where tokenRef.isEqualToData(keychainItemRef) {
                    foundToken = token;
            }
        }
        return foundToken;
    }

    func testAllTokensInKeychain() {

            return
        }

        XCTAssertEqual(thirdToken.type, OTPTokenType.Counter)
        XCTAssertEqual(thirdToken.name, "???")
        XCTAssertEqual(thirdToken.digits, 6)

        XCTAssertEqual(thirdToken.keychainItemRef, token.keychainItemRef)
        XCTAssertTrue(thirdToken.isInKeychain)

        // Remove the token
        XCTAssertTrue(token.isInKeychain)
        XCTAssertNotNil(token.keychainItemRef)

        XCTAssertTrue(token.removeFromKeychain())

        XCTAssertFalse(token.isInKeychain)
        XCTAssertNil(token.keychainItemRef)

        // Attempt to restore the deleted token
        let fourthToken = OTPToken.tokenWithKeychainItemRef(keychainItemRef)
        XCTAssertNil(fourthToken)
    }

    func testDuplicateURLs() {
