Make clear-history work correctly.