History bug fixes