Fixed bug in BFGS introduced in previous commit