Shrinking the hex generation code. Fixing a typo.