fixed bugs where MAX_PACKET_SIZE check had the wrong operator and CompressPacket tried to free static memory