Fixed RT#42811, don't add a flag if already there