- xbt_dynar_push_as(host.speed_peak, double, parse_cpu_speed(lua_tostring(L, -1)));
+ if (type == LUA_TNUMBER)
+ xbt_dynar_push_as(host.speed_peak, double, lua_tointeger(L, -1));
+ else // LUA_TSTRING
+ xbt_dynar_push_as(host.speed_peak, double, surf_parse_get_speed(lua_tostring(L, -1), "speed of host", host.id));