Fix error with empty task list