Integrated Michael's last fixes to the peak ratio calculation