Fix email error. Must trim email addresses.
Make logging a bit more sophisticated.