Fixed a bug in the computation of the gradient of the likelihood function. Added the option to use different optimization methods ( CG, LBFGS, LBFGS with numerical differentiation, and CG with bounding constraints.