Fix warnings and clean up code formatting
I pushed all the reformat code changes as separate commits to make review easier, but we should squash them into a single commit before we merge this MR.
Edited by Alberts Muktupāvels
I pushed all the reformat code changes as separate commits to make review easier, but we should squash them into a single commit before we merge this MR.