KAS:  Shifted from FlagsEnum to SourceFlagsEnum and using bit operator.  There's a problem with large datasets, however.