Accept more functions for filter.

Per Ray's suggestion.