     // This should be private, but is public for testing purposes
     func generatePasswordForCounter(counter: UInt64) -> String? {
         if let token = token {
-            return generatePassword(token.core.algorithm, token.core.digits, token.core.secret, counter)
+            return generatePassword(token.core.algorithm, digits: token.core.digits, secret: token.core.secret, counter: counter)
         }
         return nil
     }

    }

    static func tokenWithURL(url: NSURL, secret: NSData?) -> Self? {
        if let urlString = url.absoluteString {
            if let token = Token.URLSerializer.deserialize(urlString, secret: secret) {
                let otp = self.init()
                otp.updateWithToken(token)
                return otp
            }
        }
        return nil
    }

    func saveToKeychain() -> Bool {
        if let token = token {
            if let keychainItem = self.keychainItem {
                if let newKeychainItem = updateKeychainItemWithToken(keychainItem, token: token) {
                    self.keychainItem = newKeychainItem
                    return true
                }
