Bug fix #281 -- better subsetting with tally()