Commit upstream changes laying around for a while.
Merge recent upstream. Not explicitly tested.