Fixed a bug in PacketBuffer