fix errors and failures checking in run_tests