Fix a bunch more preprocessor problems.  Output should compile in DM now.