      */
     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.
-     */
-    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 {
+     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 {
         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 v == rhs as! URL
        } else if self is NSNull && rhs is NSNull {
            return true
        } else if let v = self as? [MixpanelType], rhs is Array<Any?> {
            return arrayEquals(lhs: v, rhs: rhs)
        } else if let v = self as? [String : MixpanelType], rhs is [String : Any?] {
            return dictionaryEquals(lhs: v, rhs: rhs)
        } else if self == nil, rhs == nil {
            return true
        }
        return false
    }

        return true
    }

    public func equals(rhs: MixpanelType) -> Bool {
        if rhs is [MixpanelType] {
            let rhs = rhs as! [MixpanelType]
            
            if self.count != rhs.count {
                return false
            }

            if !isValidNestedTypeAndValue() {
                return false
            }
            
            let lhs = self as! [MixpanelType]
            for (i, val) in lhs.enumerated() {
                if !val.equals(rhs: rhs[i]) {
                    return false
                }
            }
            return true
        }
        return false
    }
}

