Merge recent math branch updates into master.