Corrected segfault in packet_init