Some more minor improvements

No relevant changes. Just a few very minor improvements/fixes. All commits should be ready to cherry pick.