diff --git a/VECTO/GUI/GearboxForm.vb b/VECTO/GUI/GearboxForm.vb
index e7444abdc5ac65f7600b80ec8b50e088306854f6..5d331792aa53f5c59277d75f2caf9e5cfbe62bc5 100644
--- a/VECTO/GUI/GearboxForm.vb
+++ b/VECTO/GUI/GearboxForm.vb
@@ -102,7 +102,7 @@ Public Class GearboxForm
 		TbMinTimeBetweenShifts.Text = DeclarationData.Gearbox.MinTimeBetweenGearshifts.ToGUIFormat()
 		'cDeclaration.MinTimeBetweenGearshift(GStype)
 
-		TbTqResv.Text = (DeclarationData.Gearbox.TorqueReserve * 100).ToGUIFormat()									  ' cDeclaration.TqResv
+		TbTqResv.Text = (DeclarationData.Gearbox.TorqueReserve * 100).ToGUIFormat()										  ' cDeclaration.TqResv
 		TbTqResvStart.Text = (DeclarationData.Gearbox.TorqueReserveStart * 100).ToGUIFormat() 'cDeclaration.TqResvStart
 		TbStartSpeed.Text = DeclarationData.Gearbox.StartSpeed.ToGUIFormat()	'cDeclaration.StartSpeed
 		TbStartAcc.Text = DeclarationData.Gearbox.StartAcceleration.ToGUIFormat()	' cDeclaration.StartAcc
@@ -911,10 +911,11 @@ Public Class GearboxForm
 		If (rDyn.IsEqual(0)) Then
 			Return Nothing
 		End If
-		Dim shiftLines As ShiftPolygon = DeclarationData.Gearbox.ComputeShiftPolygon(CType(CbGStype.SelectedValue, GearboxType), gear - 1,
-																					engine.FullLoadCurves(CType(gear, UInteger)), gears, engine,
-																					Double.Parse(LvGears.Items(0).SubItems(GearboxTbl.Ratio).Text, CultureInfo.InvariantCulture),
-																					(rDyn))
+		Dim shiftLines As ShiftPolygon = DeclarationData.Gearbox.ComputeShiftPolygon(
+			CType(CbGStype.SelectedValue, GearboxType), gear - 1,
+			engine.FullLoadCurves(CType(gear, UInteger)), gears, engine,
+			Double.Parse(LvGears.Items(0).SubItems(GearboxTbl.Ratio).Text, CultureInfo.InvariantCulture),
+			(rDyn))
 		Return shiftLines
 	End Function
 
@@ -926,7 +927,10 @@ Public Class GearboxForm
 			If _
 				gbx(i).SubItems(GearboxTbl.Ratio).Text <> "" AndAlso Double.TryParse(gbx(i).SubItems(GearboxTbl.Ratio).Text, value) _
 				Then
-				Dim maxSpeed As PerSecond = If(String.IsNullOrWhiteSpace(gbx(i).SubItems(GearboxTbl.MaxSpeed).Text), Nothing, gbx(i).SubItems(GearboxTbl.MaxSpeed).Text.ToDouble().RPMtoRad())
+				Dim maxSpeed As PerSecond =
+						If _
+						(String.IsNullOrWhiteSpace(gbx(i).SubItems(GearboxTbl.MaxSpeed).Text), Nothing,
+						gbx(i).SubItems(GearboxTbl.MaxSpeed).Text.ToDouble().RPMtoRad())
 				retVal.Add(
 					New TransmissionInputData() _
 							With {.Ratio = value, .MaxInputSpeed = maxSpeed})
@@ -974,6 +978,10 @@ Public Class GearboxForm
 	End Sub
 
 	Private Sub btnExportXML_Click(sender As Object, e As EventArgs) Handles btnExportXML.Click
+		If Not Cfg.DeclMode Then
+			MsgBox("XML Export is only supported in Declaration Mode")
+			Exit Sub
+		End If
 		If Not FolderFileBrowser.OpenDialog("") Then
 			Exit Sub
 		End If
@@ -991,6 +999,10 @@ Public Class GearboxForm
 	End Sub
 
 	Private Sub btnExportAxlGearXML_Click(sender As Object, e As EventArgs) Handles btnExportAxlGearXML.Click
+		If Not Cfg.DeclMode Then
+			MsgBox("XML Export is only supported in Declaration Mode")
+			Exit Sub
+		End If
 		If Not FolderFileBrowser.OpenDialog("") Then
 			Exit Sub
 		End If
diff --git a/VECTO/GUI/MainForm.Designer.vb b/VECTO/GUI/MainForm.Designer.vb
index bea024c9f0a7009523dd6109cb5d464aacace9b0..bf88bcc11cf8cfdc9c6a59b4c170df5d5717da6a 100644
--- a/VECTO/GUI/MainForm.Designer.vb
+++ b/VECTO/GUI/MainForm.Designer.vb
@@ -60,6 +60,7 @@ Partial Class MainForm
 		Me.TabPgOptions = New System.Windows.Forms.TabPage()
 		Me.PanelOptAllg = New System.Windows.Forms.Panel()
 		Me.GroupBox3 = New System.Windows.Forms.GroupBox()
+		Me.cbActVmod = New System.Windows.Forms.CheckBox()
 		Me.cbValidateRunData = New System.Windows.Forms.CheckBox()
 		Me.GroupBox2 = New System.Windows.Forms.GroupBox()
 		Me.ChBoxModOut = New System.Windows.Forms.CheckBox()
@@ -114,7 +115,6 @@ Partial Class MainForm
 		Me.OpenInGraphWindowToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
 		Me.ShowInFolderToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
 		Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
-		Me.cbActVmod = New System.Windows.Forms.CheckBox()
 		Me.StatusBAR.SuspendLayout()
 		Me.TabControl1.SuspendLayout()
 		Me.TabPageGEN.SuspendLayout()
@@ -393,6 +393,15 @@ Partial Class MainForm
 		Me.GroupBox3.TabStop = False
 		Me.GroupBox3.Text = "Misc"
 		'
+		'cbActVmod
+		'
+		Me.cbActVmod.Location = New System.Drawing.Point(6, 41)
+		Me.cbActVmod.Name = "cbActVmod"
+		Me.cbActVmod.Size = New System.Drawing.Size(161, 63)
+		Me.cbActVmod.TabIndex = 18
+		Me.cbActVmod.Text = "Output values in vmod at beginning and end of simulation interval (EXPERT!)"
+		Me.cbActVmod.UseVisualStyleBackColor = True
+		'
 		'cbValidateRunData
 		'
 		Me.cbValidateRunData.AutoSize = True
@@ -803,15 +812,6 @@ Partial Class MainForm
 		Me.ShowInFolderToolStripMenuItem.Size = New System.Drawing.Size(173, 22)
 		Me.ShowInFolderToolStripMenuItem.Text = "Show in Folder"
 		'
-		'cbActVmod
-		'
-		Me.cbActVmod.Location = New System.Drawing.Point(6, 41)
-		Me.cbActVmod.Name = "cbActVmod"
-		Me.cbActVmod.Size = New System.Drawing.Size(161, 63)
-		Me.cbActVmod.TabIndex = 18
-		Me.cbActVmod.Text = "Output values in vmod at beginning and end of simulation interval (EXPERT!)"
-		Me.cbActVmod.UseVisualStyleBackColor = True
-		'
 		'MainForm
 		'
 		Me.AcceptButton = Me.btStartV3
diff --git a/VECTO/GUI/MainForm.resx b/VECTO/GUI/MainForm.resx
index 7a10cc6bc771ee05159f0a0d4132dbe37d358569..1ab95c20be0eb1a9777f7aae6720fb67961848f1 100644
--- a/VECTO/GUI/MainForm.resx
+++ b/VECTO/GUI/MainForm.resx
@@ -223,9 +223,6 @@
   <metadata name="CmOpenFile.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>732, 12</value>
   </metadata>
-  <metadata name="ToolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>850, 12</value>
-  </metadata>
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>49</value>
   </metadata>
diff --git a/VECTO/GUI/XMLExportJobDialog.vb b/VECTO/GUI/XMLExportJobDialog.vb
index 48236bee9e9b37d7e9ae82267b83d7bf3c9ffe2f..66ad6efc8552b89e50a23cba8fc16923c89c97aa 100644
--- a/VECTO/GUI/XMLExportJobDialog.vb
+++ b/VECTO/GUI/XMLExportJobDialog.vb
@@ -12,13 +12,13 @@ Public Class XMLExportJobDialog
 	Public Sub Initialize(data As IInputDataProvider)
 		Dim source As String
 		Dim allowSingleFile As Boolean
-		Dim eng As IEngineeringInputDataProvider = CType(data, IEngineeringInputDataProvider)
+		Dim eng As IEngineeringInputDataProvider = TryCast(data, IEngineeringInputDataProvider)
 		If (Not eng Is Nothing AndAlso Not eng.JobInputData().SavedInDeclarationMode) Then
 			source = eng.JobInputData().JobName
 			_mode = ExecutionMode.Engineering
 			allowSingleFile = True
 		Else
-			Dim decl As IDeclarationInputDataProvider = CType(data, IDeclarationInputDataProvider)
+			Dim decl As IDeclarationInputDataProvider = TryCast(data, IDeclarationInputDataProvider)
 			If (Not decl Is Nothing AndAlso decl.JobInputData().SavedInDeclarationMode) Then
 				source = decl.JobInputData().JobName
 				_mode = ExecutionMode.Declaration