Fix conversion from string to enum