Change keepRunning bool toa set of flags.