small fixes in email sending