Some minor changes to the codegen of core classes