Made adding a dependency tree into dependencies a transaction.