Improved equivalency check for filters.