Reset counter correctly.