fix scope of existing count variables - they are member variables, not
static variables