Fix HistoryManager and Test