Correct some packet ownership and freeing bugs.