Improve the test and change the HistoryFileWriter to overwrite the
existing history file.