                 }
             }
             let iKeyString = String(NSString(bytes: iKey[0], length: iKeyLength[0], encoding: NSUTF8StringEncoding))
-            
-            let iData: UnsafeMutablePointer<UnsafeMutablePointer<Void>> = nil
-            let iDataLength: UnsafeMutablePointer<Int> = nil
-            levelDBIteratorGetValue(iterator, iData, iDataLength)
-            let v : AnyObject? = (predicate == nil) ? nil : decoder(iKeyString, NSData(bytes: iData[0], length: iDataLength[0]))
-            if let predicate = predicate, value = v {
-                if predicate.evaluateWithObject(value) {
+            if let predicate = predicate {
+                let iData: UnsafeMutablePointer<UnsafeMutablePointer<Void>> = nil
+                let iDataLength: UnsafeMutablePointer<Int> = nil
+                levelDBIteratorGetValue(iterator, iData, iDataLength)
+                let v = decoder(iKeyString, NSData(bytes: iData[0], length: iDataLength[0]))
+                if predicate.evaluateWithObject(v) {
                     block(iKeyString, &stop)
                 }
             } else {

                // Otherwise, we start at the provided prefix
                levelDBIteratorSeek(iterator, startingKey.cString, len)
            }
            //}
        } else if let key = key {
            levelDBIteratorSeek(iterator, key.cString, key.length)
        } else if backward {

    func deleteDatabaseFromDisk() {
        self.close()
        let fileManager = NSFileManager.defaultManager()
        do {
            try fileManager.removeItemAtPath(path)
        }
