Fixed ThreadScheduler premature disposal.