Fix enumeration handling code generation