diff --git a/MAC/APL/Appl_Controller/ApplController.cc b/MAC/APL/Appl_Controller/ApplController.cc
index d717b2f0a10129d5cdbc57481c5b830e9268a048..4de617a9640c09e5b714f47a7a32ae0903d5dc3a 100644
--- a/MAC/APL/Appl_Controller/ApplController.cc
+++ b/MAC/APL/Appl_Controller/ApplController.cc
@@ -395,6 +395,7 @@ void ApplController::createParSubsets()
 									basePS.getString("OLAP.CNProc.partition"),
 									basePS.getString(procPrefix + "._executable"),
 									basePS.getString(procPrefix + ".workingdir"),
+                                                                        basePS.getString("Observation.ObsID"),
 									fileName, 
 									nrProcs));
 			writeParSubset(basePS, procName, fileName);
diff --git a/MAC/APL/Appl_Controller/PR_BGL.cc b/MAC/APL/Appl_Controller/PR_BGL.cc
index abad6644b7663eb674e47066b225ba902fd04465..f0bf2fc89d21d5bbb12245ab6ed8ae2267c21bb6 100644
--- a/MAC/APL/Appl_Controller/PR_BGL.cc
+++ b/MAC/APL/Appl_Controller/PR_BGL.cc
@@ -37,21 +37,24 @@ namespace LOFAR {
 		   const string&  aPartition,
 		   const string&  aExecutable,
 		   const string&  aWorkingDir,
+                   const string&  aObservationID,
 		   const string&  aParamFile,
 		   const uint numberOfNodes) :
 	ProcRule("BGLjob", aPartition, aExecutable, aParamFile)
     {
-      itsStartCmd = formatString("./startBGL.sh %s %s %s %s %s %d", 
+      itsStartCmd = formatString("./startBGL.sh %s %s %s %s %s %s %d", 
 				 aJobName.c_str(),
 				 aPartition.c_str(),
 				 aExecutable.c_str(),
 				 aWorkingDir.c_str(),
 				 aParamFile.c_str(),
+                                 aObservationID.c_str(),
 				 numberOfNodes);
 
-      itsStopCmd  = formatString("./stopBGL.sh %s %s", 
+      itsStopCmd  = formatString("./stopBGL.sh %s %s %s", 
+				 aJobName.c_str(),
 				 aPartition.c_str(),
-				 aJobName.c_str());
+                                 aObservationID.c_str());
     }
 
     PR_BGL::PR_BGL(const PR_BGL& other) :
diff --git a/MAC/APL/Appl_Controller/PR_BGL.h b/MAC/APL/Appl_Controller/PR_BGL.h
index d3f939d07914029cfde54c60d03c087b59aa7ffb..977a0a79c06c4672a17eceb1627c7a1cf880ff95 100644
--- a/MAC/APL/Appl_Controller/PR_BGL.h
+++ b/MAC/APL/Appl_Controller/PR_BGL.h
@@ -45,6 +45,7 @@ namespace LOFAR {
 	     const string& aPartition,
 	     const string& aExecutable,
 	     const string& aWorkingDir,
+             const string& aObservationID,
 	     const string& aParamfile,
 	     const uint numberOfNodes);
 
diff --git a/MAC/APL/Appl_Controller/startBGL.sh b/MAC/APL/Appl_Controller/startBGL.sh
index cac1f1752c2db1f98354a616790ea412bebe6ea7..4fb6d0071c9b12942ae388c283272053127045d7 100755
--- a/MAC/APL/Appl_Controller/startBGL.sh
+++ b/MAC/APL/Appl_Controller/startBGL.sh
@@ -4,6 +4,7 @@
 # partition
 # executable      executable file (should be in a place that is readable from BG/L)
 # workingDir      directory for output files (should be readable by BG/L)
+# observationID   observation number
 # parameterfile   jobName.ps
 # noNodes         number of nodes of the partition to use
 #
diff --git a/MAC/APL/Appl_Controller/stopBGL.sh b/MAC/APL/Appl_Controller/stopBGL.sh
index 99e6ee9b4d59ee2540c0d04403dc95a3e497cd30..5dc16d21a714a58b55ae7800cce9c7117c17fb7a 100755
--- a/MAC/APL/Appl_Controller/stopBGL.sh
+++ b/MAC/APL/Appl_Controller/stopBGL.sh
@@ -1,14 +1,21 @@
 # stopAP.sh partition jobName
 #
-# partition BG/L partition the job is running on
-# jobName   The name of the job
+# jobName       The name of the job
+# partition     BG/L partition the job is running on
+# observationID Observation number
 #
 
 #echo -n "Killing job " $2
 #killjob $1 `cat $2.jobID`
 #rm -f $2.pid $2.ps
 
-JOB=$2
-PARTITION=$1
+JOB=$1
+PARTITION=$2
+OBSID=$3
 
-/opt/lofar/bin/commandOLAP.py -P $PARTITION cancel $JOB
+# stopBGL.sh is used both to abort an observation and at the end of
+# an observation. Sleep a bit so that OLAP can temrinate on its own
+# in the latter case.
+sleep 10
+
+/opt/lofar/bin/commandOLAP.py -P $PARTITION cancel $OBSID