Fix enums having the wrong base type (issue #211)