Various style and coding tweaks