Fixed memory leak in DAGScheduler- needs more tests under error conditions.