diff --git a/R/CreateInputsModel.GRiwrm.R b/R/CreateInputsModel.GRiwrm.R
index 6401d309fe1a5130bb6b101e4c0e994f28de253e..5687ccbe386a103f00dbe9e75ac7a2ed8e3c00b0 100644
--- a/R/CreateInputsModel.GRiwrm.R
+++ b/R/CreateInputsModel.GRiwrm.R
@@ -57,19 +57,14 @@ CreateOneGRiwrmInputsModel <- function(id, griwrm, DatesR, Precip, PotEvap, Qobs
 
   if(length(UpstreamNodes) > 0) {
     # Sub-basin with hydraulic routing
-    for(idUpstrNode in UpstreamNodes) {
-      Qupstream1 <- matrix(Qobs[,idUpstrNode], ncol = 1)
-      if(is.null(Qupstream)) {
-        Qupstream <- Qupstream1
-      } else {
-        Qupstream <- cbind(Qupstream, Qupstream1)
-      }
-    }
+    Qupstream <- Qobs[ , UpstreamNodes, drop=FALSE]
     LengthHydro <- griwrm$length[griwrm$id %in% UpstreamNodes]
+    names(LengthHydro) <- UpstreamNodes
     BasinAreas <- c(
         griwrm$area[griwrm$id %in% UpstreamNodes],
         node$area - sum(griwrm$area[griwrm$id %in% UpstreamNodes], na.rm = TRUE)
     )
+    names(BasinAreas) <- c(UpstreamNodes, id)
   }
 
   # Set model inputs with the airGR function
diff --git a/R/UpdateQsimUpstream.R b/R/UpdateQsimUpstream.R
index 965196a59e4a92ef62f2375d7d83e09a289b5c59..824c128c07adffb310492d94564041e3bce76ed4 100644
--- a/R/UpdateQsimUpstream.R
+++ b/R/UpdateQsimUpstream.R
@@ -9,7 +9,7 @@
 #' @return InputsModel object with updated QobsUpsr
 #'
 UpdateQsimUpstream <- function(InputsModel, IndPeriod_Run, OutputsModel) {
-  iQ <- which(!is.na(InputsModel$BasinAreas[1:length(InputsModel$LengthHydro)]))
+  iQ <- which(!is.na(InputsModel$BasinAreas[-length(InputsModel$BasinAreas)]))
   for(i in iQ) {
     InputsModel$Qupstream[IndPeriod_Run, i] <- OutputsModel[[InputsModel$UpstreamNodes[i]]]$Qsim
   }