Remove unused log line
Move common piece of code out
Fix 'double encryption' bug
Remove stale TODOs and imports
Merge pull request #463 from bhariharan/unstable

Fix 'double encryption' bug