bug fixes for history.