Fixing minor codegen issues.
Also, allowing errors to be displayed rather than silently fail.