Fixes in packet buffer logic
PacketBuffer test code