anchor.diff:  %% State transition to the same state
   %%
   loop_keep_state(
  -  P, Debug, #state{timers = {TimerRefs,TimeoutTypes} = Timers} = S,
  +  P, Debug, #state{timers = Timers} = S,
     Events, NextState_NewData,
     NextEventsR, Hibernate, TimeoutsR, Postponed) ->
       %%
       %% Cancel event timeout
       %%
  -    case TimeoutTypes of
  -	%% Optimization
  -	%% - only cancel timer when there is a timer to cancel
  -	#{timeout := TimerRef} ->
  +    case Timers of
  +        #{timeout := {TimerRef,_TimeoutMsg}} ->
   	    %% Event timeout active
   	    loop_next_events(
                 P, Debug, S,
                 Events, NextState_NewData,
                 NextEventsR, Hibernate, TimeoutsR, Postponed,
  -	      cancel_timer_by_ref_and_type(
  -                TimerRef, timeout, TimerRefs, TimeoutTypes));
  +	      cancel_timer(timeout, TimerRef, Timers));
   	_ ->
   	    %% No event timeout active
   	    loop_next_events(
  
positive.code:         {state_data = {undefined,undefined} ::
             {State :: term(),Data :: term()},
           postponed = [] :: [{event_type(),term()}],
           timers = {#{},#{}} ::
             {%% TimerRef => TimeoutType
              TimerRefs :: #{reference() => timeout_event_type()},
              %% TimeoutType => TimerRef
              TimeoutTypes :: #{timeout_event_type() => reference()}},
            hibernate = false :: boolean()
          }).
  
  
negative.code:      state_enter = StateEnter} = P,
    #state{
       postponed = Postponed,
       timers = Timers} = S,
    Q) ->
      Log = sys:get_log(Debug),
      ?LOG_ERROR(#{label=>{gen_statem,terminate},
  