The reference is used for residual_histroy.

In the detectNewtonOscillations().
Changing the way of string comparison to ==.