   __sub__: (set) ->
     difference = @copy()
     for item in set.value.keys()
-      if @__contains__(item)
+      if @__contains__(item).value
         difference.value.pop(item)
     return difference
 

  # http://docs.python.org/library/stdtypes.html#set.remove
  remove: (elem) ->
    if elem not in @value.value
      (new KeyError "#{elem}").raise()
    else
      @value.pop(elem)
    return


  # http://docs.python.org/library/stdtypes.html#set.discard
  discard: (elem) ->
    if @__contains__(elem).value
      @value.pop(elem)
    return

