Fix history generation