I agree with his analysis. I believe we do eventually make the tweak permanent, by calling tweakBackground a second time near the end of detectFootprints, this time on the image that is retained. And the initial call tweakBackground does have a small affect, because the temporary image it is operating on is used to refine the set of peaks after the footprint regions have already been determined when doTempLocalBackground is true. But it seems like it was intended to affect the image used for footprint-region detection ("middle") as well.