Changed tests to work with optimal quantile value instead of median