Add FromPrimitive to a few enums, to allow casting from primitive types.