Fix enum warnings

Lots of compiler warnings fixes.