Fixed a bug in solver::cg