Correct min and max values when filter is changed