anchor.diff:      {stop,shutdown};
   init(sleep) ->
       ?t:sleep(1000),
  -    {state_functions,idle,data};
  +    {ok,idle,data};
   init(hiber) ->
  -    {state_functions,hiber_idle,[]};
  +    {ok,hiber_idle,[]};
   init(hiber_now) ->
  -    {state_functions,hiber_idle,[],[hibernate]};
  +    {ok,hiber_idle,[],[hibernate]};
   init({data, Data}) ->
  -    {state_functions,idle,Data};
  +    {ok,idle,Data};
   init({callback_mode,CallbackMode,Arg}) ->
  -    case init(Arg) of
  -	{_,State,Data,Ops} ->
  -	    {CallbackMode,State,Data,Ops};
  -	{_,State,Data} ->
  -	    {CallbackMode,State,Data};
  -	Other ->
  -	    Other
  -    end;
  +    ets:new(?MODULE, [named_table,private]),
  +    ets:insert(?MODULE, {callback_mode,CallbackMode}),
  +    init(Arg);
   init({map_statem,#{init := Init}=Machine}) ->
  +    ets:new(?MODULE, [named_table,private]),
  +    ets:insert(?MODULE, {callback_mode,handle_event_function}),
       case Init() of
   	{ok,State,Data,Ops} ->
  -	    {handle_event_function,State,[Data|Machine],Ops};
  +	    {ok,State,[Data|Machine],Ops};
   	{ok,State,Data} ->
  -	    {handle_event_function,State,[Data|Machine]};
  +	    {ok,State,[Data|Machine]};
   	Other ->
   	    Other
       end;
   init([]) ->
  -    {state_functions,idle,data}.
  +    {ok,idle,data}.
  +
  +callback_mode() ->
  +    try ets:lookup(?MODULE, callback_mode) of
  +	[{callback_mode,CallbackMode}] ->
  +	    CallbackMode
  +    catch
  +	error:badarg ->
  +	    state_functions
  +    end.
   
   terminate(_, _State, crash_terminate) ->
       exit({crash,terminate});
  
positive.code: 	anon -> ignore
      end,
      proc_lib:init_ack({ok, self()}),
      CallbackMode = state_functions,
      case Reg2 of
  	local ->
  	    gen_statem:enter_loop(
  	      ?MODULE, [], CallbackMode, state0, [], {local,armitage});
  	global ->
  	    gen_statem:enter_loop(
  	      ?MODULE, [], CallbackMode, state0, [], {global,armitage});
  	via ->
  	    gen_statem:enter_loop(
  	      ?MODULE, [], CallbackMode, state0, [],
  	      {via, dummy_via, armitage});
  	anon ->
  	    gen_statem:enter_loop(
  	      ?MODULE, [], CallbackMode, state0, [])
      end.
  
  
  
negative.code:     end,
  
      %% Process not started using proc_lib
      Pid4 = spawn_link(gen_statem, enter_loop, [?MODULE,[],state0,[]]),
      receive
  	{'EXIT',Pid4,process_was_not_started_by_proc_lib} ->
  	    ok
  