Some fixes for custom conversions of enums