add tests for exceptions in before and after methods and fix reporting in these cases