Added string to int conversion and range handling.