Improve basic computation of correlation functions and clean up the propagation code.