Added afterEach callback and fixed bug in error passing