Resolving most of notice and warning error

As stated in issue #21 MailWatch shoud report no error when running; thi is the first batch of correction to make it works in this way
Update functions.php