fixed some problems fitting histograms with less than full amplitude