Added error checking for integer parsing functions.