small code improvements. Still need to fix SchedulerTest.testStopConvert().