 		}
 
 	; Update PrgMonBak
-	if (lnchStat == 1)
-	RevertResLastPrgProc(maxBatchPrgs, PrgMonPID, 1)
-
+	if (lnchStat == 1 && lnchPrgIndex > 0)
+	RevertResLastPrgProc(maxBatchPrgs, PrgMonPID, , 1)
 	}
 
 

					}
					else
					{
						if (PrgChgResPrgOnClose[timerBtch] && !PrgMonPID.delete(timerfTemp))
						{
						MsgBox, 8192, PID Check, % "PID for " . PrgChoiceNames[timerBtch] . " never existed!"
						timerBtch := PrgBatchIni%btchPrgPresetSel%[A_Index]
						}
					}
				}

				if(!timerBtch)

	return state
}

RevertResLastPrgProc(maxBatchPrgs, PrgMonPID, ByRef btchPIDUserClose := 0, Init := 0)
{
Static PrgMonPIDBak := {}
; PrgMonPID has PID keys for ALL batch presets with active Prgs.
; This function only handles one Prg at a time:
; If two Prgs happen to terminate simultaneously,
; the second Prg either gets processed in the calling
; loop, or waits for the next timer call.

retVal := 0

