minor fix to 'counts' for factors