Simplify flag API. Remove some weird logic that wasn’t ever used for any reason. Provide a new method for clearing all flags