Fixed generation of classes etc. Need to look at snippets next