Store counts in a transient. Closes #2100.