Fixed bugs in remove_duplicates function when split_up_outliers was true.