On the reliability of peak-flux distributions, with an application to solar flares