Flag changes and output group bugfix