Fixed a few bugs related to e-mail delivery.

I don't always test my code, but when I do, I do it in production.