Moved from write_ubyte to write_byte