Fix some issues with expiring undo lists