Backport some stuff to the new branch.