Updated to be compatible with new minimally-sized enums, by deriving FromPrimitive on the relevant enums. This nicely cleaned up some of the code.
Merge pull request #107 from thewonderidiot/master

Fix for new minimally-sized enums