Bug fix and testFlagTable implementation