Convert to and from hexadecimal properly

Instead of using decimal prefixed with 0x, use hex prefixed with 0x