Fixes bug sending mail.