Fixed packet handler

Packet handler no longer reads null bytes + assorted changes