Avoid Enum Compare Warnings

Avoid a compiler warning about comparing disjoint enums but casting
them to int first.