Update failure count the right way.

This brings the two ways of reporting failure in line with each
other.

Closes #768.