Minor improvements in task scheduling.