Enum type inference bugs fixed