anchor.diff:          end,
       {NewContext, Insert} = run_no_block(Context, Next),
       insert_states(State, Insert),
  -    check_for_errors(NewContext, Actions).
  +    check_for_errors(NewContext).
   
   %% Handle four possible cases:
   %% - An error occured during the execution of the last process =>
  
positive.code:     %% Handle and propagate errors.
      case Reason of
          normal ->
              Action = {exit, Lid, normal},
              ?debug_1(proc_action:to_string(Action) ++ "~n"),
              Context#context{active = NewActive, action = Action};
          _Else ->
              Error = error:new(Reason),
              Action = {exit, Lid, error:type(Error)},
              ?debug_1(proc_action:to_string(Action) ++ "~n"),
              Context#context{active = NewActive, error = Error, action = Action}
      end;
  
  %% Return empty active and blocked queues to force run termination.
  handler(halt, Lid, Context, Misc) ->
      Action =
          case Misc of
              empty -> {halt, Lid};
              Status -> {halt, Lid, Status}
          end,
      ?debug_1(proc_action:to_string(Action) ++ "~n"),
      Context#context{active=?SETS:new(), blocked=?SETS:new(), action=Action};
  
  handler(is_process_alive, Lid, Context, TargetPid) ->
      TargetLid = lid:from_pid(TargetPid),
      Action = {is_process_alive, Lid, TargetLid},
      ?debug_1(proc_action:to_string(Action) ++ "~n"),
      Context#context{action = Action};
  
  handler(link, Lid, Context, TargetPid) ->
      TargetLid = lid:from_pid(TargetPid),
      Action = {link, Lid, TargetLid},
      ?debug_1(proc_action:to_string(Action) ++ "~n"),
      Context#context{action = Action};
  
  handler(monitor, Lid, Context, {Item, _Ref}) ->
      TargetLid = lid:from_pid(Item),
      Action = {monitor, Lid, TargetLid},
      ?debug_1(proc_action:to_string(Action) ++ "~n"),
      Context#context{action = Action};
  
  handler(process_flag, Lid, Context, {Flag, Value}) ->
      Action = {process_flag, Lid, Flag, Value},
      ?debug_1(proc_action:to_string(Action) ++ "~n"),
      Context#context{action = Action};
  
  %% Normal receive message handler.
  handler('receive', Lid, Context, {From, Msg}) ->
      Action = {'receive', Lid, From, Msg},
      ?debug_1(proc_action:to_string(Action) ++ "~n"),
      Context#context{action = Action};
  
  %% Receive message handler for special messages, like 'EXIT' and 'DOWN',
  %% which don't have an associated sender process.
  handler('receive_no_instr', Lid, Context, Msg) ->
      Action = {'receive_no_instr', Lid, Msg},
      ?debug_1(proc_action:to_string(Action) ++ "~n"),
      Context#context{action = Action};
  
  handler(register, Lid, Context, {RegName, RegLid}) ->
      Action = {register, Lid, RegName, RegLid},
      ?debug_1(proc_action:to_string(Action) ++ "~n"),
      Context#context{action = Action};
  
  handler(send, Lid, Context, {DstPid, Msg}) ->
      DstLid = lid:from_pid(DstPid),
      Action = {send, Lid, DstLid, Msg},
      ?debug_1(proc_action:to_string(Action) ++ "~n"),
      Context#context{action = Action};
  
  %% Link the newly spawned process to the scheduler process and add it to the
  %% active set.
  handler(spawn, ParentLid, #context{active = Active} = Context, ChildPid) ->
      link(ChildPid),
      ChildLid = lid:new(ChildPid, ParentLid),
      Action = {spawn, ParentLid, ChildLid},
      ?debug_1(proc_action:to_string(Action) ++ "~n"),
      NewActive = ?SETS:add_element(ChildLid, Active),
      Context#context{active = NewActive, action = Action};
  
  %% FIXME: Refactor this (it's exactly the same as 'spawn')
  handler(spawn_link, ParentLid, #context{active = Active} = Context, ChildPid) ->
      link(ChildPid),
      ChildLid = lid:new(ChildPid, ParentLid),
      Action = {spawn_link, ParentLid, ChildLid},
      ?debug_1(proc_action:to_string(Action) ++ "~n"),
      NewActive = ?SETS:add_element(ChildLid, Active),
      Context#context{active = NewActive, action = Action};
  
  %% FIXME: Refactor this (it's almost the same as 'spawn')
  handler(spawn_monitor, ParentLid,
          #context{active = Active} = Context, {ChildPid, _Ref}) ->
      link(ChildPid),
      ChildLid = lid:new(ChildPid, ParentLid),
      Action = {spawn_monitor, ParentLid, ChildLid},
      ?debug_1(proc_action:to_string(Action) ++ "~n"),
      NewActive = ?SETS:add_element(ChildLid, Active),
      Context#context{active = NewActive, action = Action};
  
  %% Similar to above depending on options.
  handler(spawn_opt, ParentLid,
          #context{active = Active} = Context, {Ret, Opt}) ->
      {ChildPid, _Ref} =
          case Ret of
              {_C, _R} = CR -> CR;
  
negative.code: %%   Terminate the run without errors.
  %% - There exists at least one active process =>
  %%   Continue run.
  check_for_errors(#context{error=NewError, actions=Actions, active=NewActive,
                            blocked=NewBlocked} = NewContext) ->
      case NewError of
          ?NO_ERROR ->
              case ?SETS:size(NewActive) of
  