Fix type conversion warnings for write_byte()