Error counting

It is now possible to conduct error counting and collect it from statistics. This feature is explained in more detail here.