         return !self.doubleValue.isInfinite && !self.doubleValue.isNaN
     }
     
-    public func equals(rhs: MixpanelType) -> Bool {
+    public func equals(rhs: MixpanelType?) -> Bool {
         if rhs is NSNumber {
             return self.isEqual(rhs)
         }

     */
    public func isValidNestedTypeAndValue() -> Bool { return true }

    public func equals(rhs: MixpanelType) -> Bool {
        if rhs is NSNull {
            return true
        }

     */
    func isValidNestedTypeAndValue() -> Bool
    
    func equals(rhs: MixpanelType?) -> Bool
}

extension Optional: MixpanelType {
    /**
     Checks if this object has nested object types that Mixpanel supports.
     */
    public func isValidNestedTypeAndValue() -> Bool {
        guard let val = self else { return true } // nil is valid
        switch val {
        case let v as MixpanelType:
            return v.isValidNestedTypeAndValue()
        default:
            // non-nil but cannot be unwrapped to MixpanelType
            return false
        }
    }

    public func equals(rhs: MixpanelType?) -> Bool {
        if let v = self as? String, rhs is String {
            return v == rhs as! String
        } else if let v = self as? NSString, rhs is NSString {
