Fix string to hex converter