Fix a few typos and add a backport (compat) for hex2bin()