Fixed bug in quantile, added test