If a filter with an AND or OR operation contains no actual filtering value, then remove it from the filtering chain. Fixes #1759