Fixed history saving