Fix a bug on count assignment.