anchor.diff:          fun() ->
               MatchHead = #object{pid=Pid, _='_'},
               Result = '$_',
  -            mnesia:select(object, [{MathHead, [], [Result]}])
  +            mnesia:select(object, [{MatchHead, [], [Result]}])
           end,
       case mnesia:transaction(Fun) of
           {atomic, []} ->
  -            {reply, undefined, State};
  +            undefined;
           {atomic, [Object = #object{properties = Props} | _]} ->
  -            Props2 = ids2pids(Props),
  -            {reply, Object#object{properties = Props}, State}
  +            Object#object{properties = ids2pids(Props)}
       end.
   
  -update_object(Pid, {icon, Icon})
  -    Fun = fun(Object) ->
  -              Object#object{icon = Icon}
  -          end,
  -    update_object(Pid, Fun);
  -update_object(Pid, {id, Id})
  -    Fun = fun(Object) ->
  -              Object#object{id = Id}
  -          end,
  -    update_object(Pid, Fun),
  -update_object(Pid, UpdateFun) when is_function(UpdateFun) ->
  -    Fun =
  -        fun() ->
  -            MatchHead = #object{pid=Pid, _='_'},
  -            Result = {'$_'},
  -            case mnesia:select(object, [{MathHead, [], [Result]}]) of
  -                undefined
  -        end,
  -    case mnesia:transaction(Fun) of
  -        {atomic, []} ->
  -            {reply, undefined, State};
  -        {atomic, [Object | _]} ->
  -            {reply, Object, State}
  -    end.
  -
  -subscribe_dead(Subscriber, Pid) ->
  -    fun() ->
  -        case mnesia:read(replacement_pid, Pid) of
  -            [#replacement_pid{new_pid = NewPid} | _] ->
  -                Subsriber ! {replace_pid, Pid, NewPid};
  -            [] ->
  -                mnesia:write(#dead_pid_subscription{subscriber = self(),
  -                                                    dead_pid = Pid})
  -                OneMinute = 60 * 1000,
  -                Message = {delete, #dead_pid_subscription{subscriber = self(),
  -                                                          dead_pid = Pid}},
  -                erlang:send_after(OneMinute, self(), Message).
  -        end
  -    end,
  -    mnesia:transaction(Fun),
  -
  -unsubscribe_dead(Subscriber, OldPid) ->
  -    OldRecord = #broken_link{object_pid = self(),
  -                             dead_pid = OldPid},
  -    fun() ->
  -        mnesia:delete(OldRecord)
  -    end,
  +subscribe_dead_(Subscriber, Pid) ->
  +    Fun =
  +       fun() ->
  +           case mnesia:read(replacement_pid, Pid) of
  +               [#replacement_pid{new_pid = NewPid} | _] ->
  +                   Subscriber ! {replace_pid, Pid, NewPid};
  +               [] ->
  +                   mnesia:write(#dead_pid_subscription{subscriber = self(),
  +                                                       dead_pid = Pid}),
  +                   OneMinute = 60 * 1000,
  +                   Message = {delete, #dead_pid_subscription{subscriber = self(),
  +                                                             dead_pid = Pid}},
  +                   erlang:send_after(OneMinute, self(), Message)
  +           end
  +       end,
  +    mnesia:transaction(Fun).
  +
  +unsubscribe_dead_(Subscriber, OldPid) ->
  +    OldRecord = #dead_pid_subscription{subscriber = Subscriber,
  +                                       dead_pid = OldPid},
  +    Fun =
  +        fun() ->
  +            mnesia:delete(OldRecord)
  +        end,
       {atomic, ok} = mnesia:transaction(Fun).
   
  -replace_dead(OldPid, NewPid) ->
  +replace_dead_(OldPid, NewPid) ->
       Fun =
           fun() ->
               Object = #dead_pid_subscription{dead_pid = OldPid, _ = '_'},
  -            Subs = mnesia:match_object(Object)
  +            Subs = mnesia:match_object(Object),
               [Sub ! {replace_pid, OldPid, NewPid}
  -             || #dead_pid_subscription{subscriber = Sub} <- Subs].
  +             || #dead_pid_subscription{subscriber = Sub} <- Subs],
   
               mnesia:write(#replacement_pid{old_pid = OldPid,
                                             new_pid = NewPid})
  
positive.code:                              icon = Icon,
                               properties = Props2})
      end,
      mnesia:transaction(Fun);
  
  handle_cast({update_pid, Id, Pid}, State = #state{index = Index}) ->
      Fun =
          fun() ->
              [Object = #object{properties = Props}] = mnesia:read(object, Id),
  
negative.code:         end,
      {atomic, ok} = mnesia:transaction(Fun),
      {noreply, State};
  handle_cast({subscribe_dead, Subscriber, DeadPid}, State) ->
      subscribe_dead_(Subscriber, DeadPid),
      {noreply, State};
  handle_cast({unsubscribe_dead, Subscriber, OldPid}, State) ->
      unsubscribe_dead_(Subscriber, OldPid),
      {noreply, State};
  handle_cast({replace_dead, OldPid, NewPid}, State) ->
      replace_dead_(OldPid, NewPid),
      {noreply, State};
  handle_cast(_Msg, State) ->
      {noreply, State}.
  
  handle_info({delete, Object}, State) ->
      Fun =
          fun() ->
              mnesia:delete_object(Object)
          end,
      {atomic, ok} = mnesia:transaction(Fun),
      {noreply, State};
  handle_info(_Info, State) ->
      {noreply, State}.
  
  