Fix history file writing.

Seems like it should work like this, no?  Otherwise, it's not really saving my history.
Merge pull request #1 from anaxagoras/patch-1

Fix history file writing.