Cherry-pick some fixes from master into 1.16
To continue what !20 (merged) started, this cherry-picks some fixes from master into the 1.16 branch. I think this contains the fixes up to 979382dd (my current master branch).
To continue what !20 (merged) started, this cherry-picks some fixes from master into the 1.16 branch. I think this contains the fixes up to 979382dd (my current master branch).