fix and added a test for the expected number of counts