Fix bug when converting values to code where we accidentally cast the value to str (it is supposed to be an int)