Check sanity when applying filters, and provide useful error messages.