Sync with 331301.
Update to 1.6.2.
Add back mate hacks because it wants to run autofoo in the build stage again.