unit tests for History, and bugfix for iteration on it