Merge code improvements to support historical models.