Changes to Scheduler to cleanup task scheduling