Fixed bug in generic aes.