anchor.diff:                                         fn=Fun,
                                          max_concurrent=MaxP},
                                List),
  -    % Collect pending work
  -    Collect =
  -        fun(Pid, Acc) ->
  -                receive
  -                    {pmap_result, Pid, R} ->
  -                        [R|Acc]
  -                end
  -        end,
  -    All = lists:foldl(Collect, Done, Pending),
  +    All = pmap_collect_rest(Pending, Done),
       % Restore input order
       Sorted = lists:keysort(1, All),
       [ R || {_, R} <- Sorted ].
  
positive.code:                   mapper,
                    fn,
                    n_pending=0,
                    pending=[],
                    n_done=0,
                    done=[],
                    max_concurrent=1
  
negative.code:                            R = Fn(X),
                             Mapper ! {pmap_result, self(), {NP+ND, R}}
                     end),
      Acc#pmap_acc{n_pending=NP+1, pending=sets:add_element(Worker, Pending)};
  pmap_worker(X, Acc = #pmap_acc{n_pending=NP,
                                 pending=Pending,
                                 n_done=ND,
  