Minor:  Possibly simpler to have the flag values starting at 0x100, then you would avoid the shifts.