Merge "Revert "[PIA] add missing flag checks"" into main