Some optimizations in Packet class for better readibility and less bugs on checking version.