Added way to send emails when there's a failure in the tests, small fixes