Bug in history file creation