Fixing bugs in email sending.