fixed a few ugly lines of code
Writing email tests
Merged conflicts with Soham