Fix int-to-enum casting