BFGS implementation doe does crash but also does not work.