Replaced atoi call with strtol