Cosmetic adjustments and warning fixes

This needs review before merging in.