Style fixes and other cleanup

Per Osmose's comments on the previous commit.