Fix logic in CustomGridFilter.