Fixed unit test for Nelder-Mead.