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