Fix several bugs in the waveform reconstruction code.
Also, try to improve the fitting convergence for the CB fits.