Fixed the support generator.
Bunch more refactoring.