Fix the cumulative density calculation problem