Fixed count function
Minor tests update