Fix clang compiler warning: Cast enum to int for comparison.