Fix bfgs unit test.