Added methods to get the error and iteration number.