Added error output to CG algorithm.