Fixes error stats counting