Improve flags

Related to #4441