counter tests and fixes for counters.