More hacks to make things like trace fitting and spectra extraction
more robust in the case of poor datasets.