Fix history file