Fixes #5692 - correct counts in cached_counters