anchor.diff:        Set2 :: set(Element).
   del_element(E, S0) ->
       Slot = get_slot(S0, E),
  -    {S1,Dc} = on_bucket(fun (B0) -> del_bkt_el(E, B0) end, S0, Slot),
  -    maybe_contract(S1, Dc).
  -
  --spec del_bkt_el(T, [T]) -> {[T], 0 | 1}.
  -del_bkt_el(E, [E|Bkt]) -> {Bkt,1};
  -del_bkt_el(E, [Other|Bkt0]) ->
  -    {Bkt1,Dc} = del_bkt_el(E, Bkt0),
  -    {[Other|Bkt1],Dc};
  -del_bkt_el(_, []) -> {[],0}.
  +    Bkt = get_bucket(S0, Slot),
  +    case lists:member(E, Bkt) of
  +        false ->
  +            S0;
  +        true ->
  +            S1 = update_bucket(S0, Slot, lists:delete(E, Bkt)),
  +            maybe_contract(S1, 1)
  +    end.
  +
  +%% update_bucket(Set, Slot, NewBucket) -> UpdatedSet.
  +%%  Replace bucket in Slot by NewBucket
  +-spec update_bucket(Set1, Slot, Bkt) -> Set2 when
  +      Set1 :: set(Element),
  +      Set2 :: set(Element),
  +      Slot :: non_neg_integer(),
  +      Bkt :: [Element].
  +update_bucket(Set, Slot, NewBucket) ->
  +    SegI = ((Slot-1) div ?seg_size) + 1,
  +    BktI = ((Slot-1) rem ?seg_size) + 1,
  +    Segs = Set#set.segs,
  +    Seg = element(SegI, Segs),
  +    Set#set{segs = setelement(SegI, Segs, setelement(BktI, Seg, NewBucket))}.
   
   %% union(Set1, Set2) -> Set
   %%  Return the union of Set1 and Set2.
  
positive.code:     Seg = setelement(BktI, element(SegI, Segs), Bkt),
      setelement(SegI, Segs, Seg).
  
  -spec maybe_expand(set(E), 0 | 1) -> set(E).
  maybe_expand(T0, Ic) when T0#set.size + Ic > T0#set.exp_size ->
      T = maybe_expand_segs(T0),			%Do we need more segments.
      N = T#set.n + 1,				%Next slot to expand into
      Segs0 = T#set.segs,
  
negative.code: -spec get_bucket(set(), non_neg_integer()) -> term().
  get_bucket(T, Slot) -> get_bucket_s(T#set.segs, Slot).
  
  %% fold_set(Fun, Acc, Dictionary) -> Dictionary.
  %% filter_set(Fun, Dictionary) -> Dictionary.
  
  