make decrypt more error prone, and fix a few bugs of decryption