Add packet expansion method
Fix heap overflow