This is needed because wildcard expansion causes counters to be localized. (cherry picked from commit 1690f36b09)
1690f36b09