Added better error messages about invalid enums.