Completed mail address check and fixed some errors