Adds missing filter functionality to count()