Fixing email bugs