Fix a bug introduced with allocation counters