Merge pull request #827 from sipa/fixencrypt