Nelder-Mead run time errors fixed