fixed a few bugs in check_mail - not that I ever use it