         }
         #if swift(>=3.0)
             if let rawData = rawData {
-        #endif
-        let data = NSData(bytes: rawData, length: rawDataLength)
-        return decoder(key, data)
-        #if swift(>=3.0)
+            let data = NSData(bytes: rawData, length: rawDataLength)
+            return decoder(key, data)
             } else {
             return nil
             }
+        #else
+            let data = NSData(bytes: rawData, length: rawDataLength)
+            return decoder(key, data)
         #endif
     }
     

            levelDBIteratorGetKey(iterator, &iKey, &iKeyLength)
            #if swift(>=3.0)
                if let iKey = iKey {
            #endif
            if let prefix = prefix {
                if memcmp(iKey, prefix.cString, min(prefix.length, iKeyLength)) != 0 {
                    break
                }
            }
            if let iKeyString = NSString(bytes: iKey, length: iKeyLength, encoding: stringEncoding) as? String {
                if let predicate = predicate {
                    #if swift(>=3.0)
                        var iData: UnsafeMutableRawPointer? = nil
                    #else
                        var iData: UnsafeMutableRawPointer = nil
                    #endif
                    var iDataLength: Int = 0
                    levelDBIteratorGetValue(iterator, &iData, &iDataLength)
                    #if swift(>=3.0)
                        if let iData = iData {
                    #endif
                    let v = decoder(iKeyString, NSData(bytes: iData, length: iDataLength))
                    #if swift(>=3.0)
                        if predicate.evaluate(with: v) {
                        block(iKeyString, &stop)
                        }
                    #else
                        if predicate.evaluateWithObject(v) {
                            block(iKeyString, &stop)
                        }
                    #endif
                    #if swift(>=3.0)
                        }
                    #endif
                } else {
                    block(iKeyString, &stop)
                }
            }
            #if swift(>=3.0)
                }
            #endif
            if stop {

                var iKeyLength: Int = 0
                levelDBIteratorGetKey(iterator, &iKey, &iKeyLength)
                #if swift(>=3.0)
                    if len > 0, let iKey = iKey {
                    let cmp = memcmp(iKey, startingKey.cString, len)
                    if cmp > 0 {
                    levelDBIteratorMoveBackward(iterator)
                    }
                    }
                #else
                    if len > 0 {
                        let cmp = memcmp(iKey, startingKey.cString, len)
                        if cmp > 0 {
                            levelDBIteratorMoveBackward(iterator)
                        }
                    }
                #endif
            } else {
