Improve flag handling
Check flag existence before setting meta variable