Fixed a bug in encryption.