Updated tests and fixed bug in email notificaiton system