Fix problem in hex conversion