Fix issue #322 by deferring the writing of the generated module adapter until all the generation is done in-memory, and interpret Error nodes from the AST more liberally, taking the raw type information from the text of the Error node.