Fixed inferred latch bug in perf counters