Minor tweaks to error counting