numerical and minimization improvements