Use getint instead of manual casting