anchor.diff:      Res = timer:tc(?MODULE, do_measure_codec_loop, 
   		   [Codec, Func, Conf, Version, M, MCount, dummy]),
       case Res of
  -	{Time, {ok, _}} when is_integer(Time) ->
  +	{Time, {ok, _}} when is_integer(Time) andalso (Time > 0) ->
   	    %% OK so far, now calculate the count:
  -	    Count = round(?MEASURE_COUNT_TIME/(Time/MCount)),
  -	    %% io:format("~w ", [Count]),
  -	    {ok, Count};
  +            %% For some reason we get a 'badarith' on some platforms
  +            %% here. Since this is just the warmup we can try-catch.
  +            try round(?MEASURE_COUNT_TIME/(Time/MCount)) of
  +                Count ->
  +                    {ok, Count}
  +            catch
  +                _:_:_ ->
  +                    {error, {failed_calculated_count, Time, MCount}}
  +            end;
   	{Time, Error} ->
   	    {error, {warmup_failed, Time, Error}}
       end.
  
positive.code:        is_atom(Func) andalso
         is_list(Conf) andalso
         is_integer(MCount) andalso (MCount > 0) ->
      Self = self(),
      Pid  = spawn_link(?MODULE, do_measure_codec, 
                        [Factor, Self, Codec, Func, Conf, Version, Bin, MCount]),
      receive
  	{measure_result, Pid, Func, Res} ->
  	    {ok, Res};
  	{error, Pid, Error} ->
  	    {error, Error};
  	Else ->
  	    {error, {unexpected_result, Else}}
      after ?MEASURE_TIMEOUT ->
  	    Info = 
  		case (catch process_info(Pid)) of
  		    I when is_list(I) ->
  			exit(Pid, kill),
  			I;
  		    _ ->
  
negative.code:     end.
  
  
  do_measure_codec(Factor, Codec, Func, Conf, Version, Bin, MCount) ->
      {ok, Count} = measure_warmup(Codec, Func, Conf, Version, Bin, MCount),
      Count2      = Count div Factor,
      Res = timer:tc(?MODULE, do_measure_codec_loop, 
  		   [Codec, Func, Conf, Version, Bin, Count2, dummy]),
      case Res of
  	{Time, {ok, M}} ->
  	    exit({measure_result, {M, Count2, Time}});
  	{_Time, Error} ->
              exit({error, Error})
      end.
  
  
  %% This function does more or less what the real measure function
  