Fixed hex/bytes conversion so that unit tests still pass.