Minor bugfix for fitting