Encryption fixes