CHG: Fixed crashes when deleting and creating fits, improved memory usage, improved selection which fits are used, draw line at residual energy = 0 keV