Clean up goals and remove Terminated state.