fixing compiler warnings related to improper enum casting.