Fix crash in history when removing last entry.