Fix percentage calculation in density measurements.