Made kminvalues.realtive_error safer when we can't converge to a solution