Static analysis fixes.
Simplified text emails generation.