Fix flag logic
Add single flag pop