Fix some code style/formatting
cherry picked from !916 (merged)
One extra small manual conflict had to be resolved. Just a semicolon though. Because one of master-only porting MRs also touched code style a bit. I really had to avoid doing such changes there. But oh well…