Adding count support and tests.