Better error handling for parsing ints