Fixed BFGS issue (wrong sign on gradient)