Fix API breakage for enums/bitmasks. Note that the old protocols definition was broken (several protocols had more than one bit set).