minor code cleanups

Dropped the header changes since it's not compatible with older build systems. Hopefully I can get these two through the buildbot.