add h_max and catch division by zero in minimizer step size control