Merge recent backports and bugfixes from master to edge.