Fix two bugs in the handling of codegen for typedefs.