Some fixes to not crash

Next up is refactoring the resource references to start generating valid classes.