Improved the way it checks if the packet is encrypted. Caused some problems if the packet was not encrypted, but the length was incorrect.