Fix errors when calculate percentiles of a empty list