Generalized flag support

TBR