Fix various styling issues

Fixes #802 and #652, along with a new header issue from the Qt5 migration.