Fix a bug on count assignments.