Minor coding-style related changes

A little cleanup in a few files, including some small refactorings.