Fixed bug in fit_profile.