Fix bug that was causing updateCounts to fail