modification of fitFunctions.cpp and bug fixed in Fit_Selection.cpp