Asserting action count in tests. minor changes.