Implement counter caches for bugs.