anchor.diff:      NewRefs = case dict:find(Pid, Refs) of
                     error -> Refs;
                     {ok, Ref} -> erlang:demonitor(Ref, [flush]),
  -                               dict:erase(Pid)
  +                               dict:erase(Pid, Refs)
                 end,
   
       F = fun() -> mnesia:delete({publishers, Pid}) end,
  
positive.code:     NewRefsSub = case dict:find(Pid, RefsSub) of
                    error -> Refs;
                       {ok, RefSub} -> erlang:demonitor(RefSub, [flush]),
                                       dict:erase(Pid)
                end,
  
      F2 = fun() -> mnesia:delete({subscribers, Pid}) end,
  
negative.code:     mnesia:activity(transaction, F),
      {noreply, State#state{refs_pub=NewRefs}};
  
  handle_cast({leave_exchange, _UserId, _ExchangeName, From}, State=#state{refs_pub=Refs}) ->
      F = fun() -> mnesia:delete({publishers, From}) end,
      mnesia:activity(transaction, F),
      NewRefs = case dict:find(From, Refs) of
  