pulsecounter: bugfix + unittests