Add some global vars to track system state.