Move flags to flagset to allow special external flag handling.