Avoid saving empty history.
Improve example.