Support filtering by arbitrary boolean functions.
Fix typo in comment.