Add proper error checking in asciihex2int functions