         var item:*;
         var newSet:Set = a.clone();
 
-        for each (item in b.dict)
-            if (!newSet.remove(item))
-                newSet.add(item);
+        if (a !== b)
+        {
+            for each (item in b.dict)
+                if (!newSet.remove(item))
+                    newSet.add(item);
+        }
 
         return newSet;
     }

    public static function intersection(a:Set, b:Set):Set
    {
        var item:*;
        var newSet:Set = new Set();

        for each (item in a.dict)
            if (b.contains(item))
                newSet.add(item);

        return newSet;
    }

    {
        var item:*;

        if (this === test)
        {
            return true;
        }
        else
        {
            for each (item in dict)
                if (!test.contains(item))
                    return false;

            return true;
        }
    }

    /**
