Fix crash when reading from empty history file