Corrected numerous compilation regressions.

I believe we've finally hunted down all regressions related to the
recent conversion from exported to unexported globals, may the Sun set
on their unyielding, pockmarked souls.