fixed total tests count, added stacktrace handling, refactoring