Fix defition of `StopOnError` class.