Minor fixes to SMTP code