Fixed string to int conversion bug