Fix tests/code from plugins and smtp
Merge pull request #641 from knownasilya/fix-tests

Fix tests/code from plugins and smtp