do_phase_fit.c was modified to fix the "degree of freedom" problem for velocity error derivation