Clean up handling of string to int conversion.