Merge "DO NOT MERGE Fix security exception due to incorrect flags" into pi-dev