fix lots of stuff so that macros compiled separately still work together