         var err:NSError?
         let enc = NSUTF8StringEncoding
         var obj:AnyObject? = NSJSONSerialization.JSONObjectWithData(
-            str.dataUsingEncoding(enc), options:nil, error:&err
+            str.dataUsingEncoding(enc)!, options:nil, error:&err
         )
         return err != nil ? JSON(err!) : JSON(obj!)
     }

                return (i, JSON(o[i]))
            }
        case let o as NSDictionary:
            var ks = o.allKeys!.reverse()
            return GeneratorOf<(AnyObject, JSON)> {
                if ks.isEmpty { return nil }
                let k = ks.removeLast() as String
                return (k, JSON(o.valueForKey(k)))
            }
        default:
            return GeneratorOf<(AnyObject, JSON)>{ nil }

    public var asDate:NSDate? {
        if let dateString = _value as? NSString {
            let dateFormatter = NSDateFormatter()
            dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZ"
            return dateFormatter.dateFromString(dateString)
        }
        return nil
