anchor.diff:              pick_chunks(chunkify_piece, {Pid, Id, PieceSet, SoFar, Remaining, none});
           found_chunked ->
               pick_chunks(chunkify_piece, {Pid, Id, PieceSet, SoFar, Remaining, found_chunked});
  -	Selected when is_list(Selected) ->
  -	    {ok, {PieceNum, Chunks}, Size} =
  -                select_chunks_by_piecenum(Selected, Remaining, Pid),
  -            pick_chunks(pick_chunked, {Pid, Id,
  -                                       gb_sets:del_element(PieceNum, PieceSet),
  -                                       [{PieceNum, Chunks} | SoFar],
  -                                       Remaining - Size, Res})
  +	PN when is_integer(PN) ->
  +	    case select_chunks_by_piecenum({Id, PN}, Remaining) of
  +		{ok, {PieceNum, Chunks}, Size} ->
  +		    pick_chunks(pick_chunked, {Pid, Id,
  +					       gb_sets:del_element(PieceNum, PieceSet),
  +					       [{PieceNum, Chunks} | SoFar],
  +					       Remaining - Size, Res});
  +		{error, already_taken} ->
  +		    %% So somebody else took this, try again
  +		    pick_chunks(pick_chunked, {Pid, Id, PieceSet, SoFar, Remaining, Res})
  +	    end
       end;
   
   %%
  
positive.code:         none_eligible ->
              {ok, SoFar}
      end;
  %%
  %% Handle the endgame for a torrent gracefully
  pick_chunks(endgame, {Id, PieceSet, N}) ->
  
negative.code: pick_chunks(_Id, unknown, _N) ->
      none_eligible;
  pick_chunks(Id, Set, N) ->
      case pick_chunks(pick_chunked, {self(), Id, Set, [], N, none}) of
  	not_interested -> pick_chunks_endgame(Id, Set, N, not_interested);
  	{ok, []}       -> pick_chunks_endgame(Id, Set, N, none_eligible);
  	{ok, Items}    -> {ok, Items}
      end.
  
  % @doc Request the managing of a new torrent identified by Id
  % <p>Note that the calling Pid is tracked as being the owner of the torrent.
  