Fixing a couple of kernel panics. Also an unverified attempt to fix Issue #71.
The constructors of struct packet always use the heap now.