Minor fixes in the packet handling