 	}
 }
 
-extension Optional where T: CollectionType, T.Generator.Element: Encodable {
+extension Optional where Wrapped: CollectionType, Wrapped.Generator.Element: Encodable {
 	public func encode() -> JSON {
 		return self.map { $0.encode() } ?? .Null
 	}

	}
}

extension Optional where T: Encodable {
	public func encode() -> JSON {
		switch self {
		case .None:        return .Null

	}
}

extension Optional where Wrapped: protocol<CollectionType, DictionaryLiteralConvertible>, Wrapped.Key: StringLiteralConvertible, Wrapped.Value: Encodable, Wrapped.Generator.Element == (Wrapped.Key, Wrapped.Value) {
	public func encode() -> JSON {
		return self.map { $0.encode() } ?? .Null
	}
