Fix variable name style. Don't cast to and from int.

This enables the compiler to see the enum and produce warnings about a switch
not being fully covered. Fix one of these warnings.