Fix tests/code from plugins and smtp

In reply to #638