Exposed counter implementation. Fixed related test