Added enumeration to integer conversion.

This is for #222.