Merge "Fix the algorithm counting the package failures"