anchor.diff:      State1 = maps:put(Ref, {PartisanRef, PartisanRemote}, State),
       StateFinal = maps:put(PartisanRef, Ref, State1),
       {reply, PartisanRef, StateFinal};
  +
   handle_call({demonitor, PartisanRef}, _From, State) ->
  -    Ref = maps:get(PartisanRef, State),
  -    erlang:demonitor(Ref, [flush]),
  -    State1 = maps:remove(PartisanRef, State),
  -    StateFinal = maps:remove(Ref, State1),
  +    StateFinal = case maps:find(PartisanRef, State) of
  +        {ok, Ref} ->
  +            erlang:demonitor(Ref, [flush]),
  +            State1 = maps:remove(PartisanRef, State),
  +            maps:remove(Ref, State1);
  +        error ->
  +            ?LOG_DEBUG(#{
  +                description => "Monitor reference unknown",
  +                reference => PartisanRef
  +            }),
  +            State
  +    end,
       {reply, true, StateFinal};
  +
   handle_call(_Msg, _From, State) ->
       {reply, ok, State}.
   
  
positive.code: -module(partisan_monitor).
  
  -behaviour(partisan_gen_server).
  
  % API
  -export([start_link/0, monitor/1, demonitor/1, demonitor/2]).
  
negative.code: %% is no longer reachable.
  monitor(Pid) when is_pid(Pid) ->
      erlang:monitor(process, Pid);
  
  monitor({partisan_remote_reference, Node,
           {partisan_process_reference, PidAsList}}) ->
      partisan_gen_server:call({?MODULE, Node}, {monitor, PidAsList}).
  
  
  demonitor(Ref) when is_reference(Ref) ->
      erlang:demonitor(Ref);
  
  demonitor({partisan_remote_reference, Node,
             {partisan_encoded_reference, _}} = PartisanRef) ->
      partisan_gen_server:call({?MODULE, Node}, {demonitor, PartisanRef}).
  
  
  demonitor(Ref, Opts) when is_reference(Ref) ->
      erlang:demonitor(Ref, Opts);
  
  demonitor({partisan_remote_reference, Node,
             {partisan_encoded_reference, _}} = PartisanRef, _Opts) ->
      partisan_gen_server:call({?MODULE, Node}, {demonitor, PartisanRef}).
  