Fix logic errors in dag bootstrap.