Fixed encoding of hexlyfied string for Python 3