packet reading/writing tweaks