fix counter reset

fixes counter reset to correctly locate and set counter, as per
increment function.