Some fixes. Emails should be working.