Fixed memory leaks and moved the RooMsg instance out of the main fit fcn.