Fixes for PSR-1 and PSR-2 violations

There were some minor PSR-1 and PSR-2 violations in the codebase. They're all related to whitespace, and while I think they're pretty non-controversial I'm open to having a discussion.

I've tried to keep them in separate commits so you can `cherry-pick` if you'd prefer to ignore one or two of them.