make sure get_counts() returns a dict - fixes #159