Ensure mode flags are correctly generated after the switch to a bitmask
for activated modes.