Fix code generation functions.