Bug fixes in test and disposable and Scheduler