Fix corruption of diffraction patterns when doing TDS runs.