Correct automatic threshold on noisy histograms
(by crudely estimating gaussian parameters to remove first peak in order
to properly detect second peak which becomes the new global maximum)
Estimate threshold by fitting peaks with Lorentz distributions.
Fixes, cleanups.