Fixed the logic for checking if an element should be properly already marked as counted