Improve tests and validation for email