Fix and rename add_flags_lines