Corrected final failure count and exit code