Fix payload bug.

Optimized init packet couldn't carry the payload because it was
improperly initialized.
Also fixed unallocated memory overwrite.
Add packet debug output.