Fixed handling of octal and hexadecimal numbers