Added reproducibility check, bug fix (in fit.k)