Make Nelder-Mead pass the test by fixing the last remaining failures

The errors were due to wrong handling of slices. They are passed by reference and not by value. So the code updated points in place where it should have returned new points. This made the algorithm fail. More test cases uncovered the problem.