fixed a bug in enum_from_name() function