Error in automatic code generation