Fixing the handling of $Number% so it doesn't break when $Number is missing.
Also adding support for hex numbers.