Fix format problem in ToBytes