Fix for percentile()

Fix for percentile(), don't use an array element if it hasn't been set.