Fixed two tiny bugs with sending emails