Make PyScheduler more robust.