bugfix  to lmfit