      */
     func isValidNestedTypeAndValue() -> Bool
     
-    func equals(rhs: MixpanelType) -> Bool
+    func equals(rhs: MixpanelType?) -> Bool
 }
 
 extension Optional: MixpanelType {
     /**
      Checks if this object has nested object types that Mixpanel supports.
-     Will always return true.
-     */
-    public func isValidNestedTypeAndValue() -> Bool {
-        if let val = self {
-            switch val {
-            case let mpt as MixpanelType:
-                return mpt.isValidNestedTypeAndValue()
-            default:
-                // non-nil but cannot be unwrapped to MixpanelType
-                return false
-            }
-        }
-        // nil is valid
-        return true
-    }
-
-    public func equals(rhs: MixpanelType) -> Bool {
+     */
+    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 {

        return !self.doubleValue.isInfinite && !self.doubleValue.isNaN
    }
    
    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 Date {
            return self == rhs as! Date
        }
