Fix uninitialized packet members

also cast packet data explicitly