Fix up fixing up of flags.