Multiple fixes in CryptoEngine