Fix term counts when terms span taxonomies Closes #4738