Merge 1.x improvements into the 2.x branch.