Add toUnsignedBytes as a substitute for flag