History implementation and bugfixes