Optimizing using scipy.optimize.fmin_bfgs but running into a few problems