patch that makes sure that histograms are written even for short runs