diff --git a/Makefile b/Makefile
index 5c57efa657b79be0a75aaab170844c3985483c96..cd106175af413e2a347c61ce17786c9298ff4bbe 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ BASE=rules_shipping
 BASE_ADV=rules_shipping_advanced
 PLUGINTYPE=vmshipment
 ZIPBASE=opentools_vm2
-VERSION=4.0
+VERSION=4.0.1
 
 PLUGINFILES=$(BASE).php $(BASE)_base.php $(BASE).script.php $(BASE).xml index.html
 PLUGINFILES_ADV=$(BASE_ADV).php $(BASE)_base.php $(BASE_ADV).script.php $(BASE_ADV).xml index.html
diff --git a/releases/plg_opentools_vm2_rules_shipping_v4.0.1.zip b/releases/plg_opentools_vm2_rules_shipping_v4.0.1.zip
new file mode 100644
index 0000000000000000000000000000000000000000..d8da980f9b156c98814620346662c7565b9d67c2
Binary files /dev/null and b/releases/plg_opentools_vm2_rules_shipping_v4.0.1.zip differ
diff --git a/rules_shipping.xml b/rules_shipping.xml
index 1c31e6e34ede7273475283ea2f210c27e503d1f9..eb8b28c6ea5261405b8ff49bcb54fb0fab5e1c41 100644
--- a/rules_shipping.xml
+++ b/rules_shipping.xml
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <install version="1.5" type="plugin" group="vmshipment" method="upgrade">
     <name>VMSHIPMENT_RULES</name>
-    <creationDate>2013-02-08</creationDate>
+    <creationDate>2014-01-14</creationDate>
     <author>Reinhold Kainhofer</author>
     <authorUrl>http://www.open-tools.net</authorUrl>
     <copyright>Copyright (C) 2013, Reinhold Kainhofer</copyright>
     <license>GPL v3+</license>
-    <version>4.0</version>
+    <version>4.0.1</version>
     <description>VMSHIPMENT_RULES_DESC</description>
     <files>
 	<filename plugin="rules_shipping">rules_shipping.php</filename>
diff --git a/rules_shipping_advanced.xml b/rules_shipping_advanced.xml
index 058b612b87b831ea845935148d755795c412e7f6..5cf2a7cc971ec8bcc687f870055779992e3f548d 100644
--- a/rules_shipping_advanced.xml
+++ b/rules_shipping_advanced.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <install version="1.5" type="plugin" group="vmshipment" method="upgrade">
     <name>VMSHIPMENT_RULES_ADV</name>
-    <creationDate>2013-02-08</creationDate>
+    <creationDate>2014-01-12</creationDate>
     <author>Reinhold Kainhofer</author>
     <authorUrl>http://www.open-tools.net</authorUrl>
     <copyright>Copyright (C) 2013, Reinhold Kainhofer</copyright>
diff --git a/rules_shipping_base.php b/rules_shipping_base.php
index 08a2635b330960d5109e87be9ca7bd22b8e82e79..7a8c3ec38b0acd72b93269324cb5dbf15c6d696d 100644
--- a/rules_shipping_base.php
+++ b/rules_shipping_base.php
@@ -33,6 +33,8 @@ if (class_exists ('plgVmShipmentRules_Shipping_Base')) {
 function is_equal($a, $b) {
 	if (is_array($a) && is_array($b)) {
 		return !array_diff($a, $b) && !array_diff($b, $a);
+	} elseif (is_string($a) && is_string($b)) {
+		return strcmp($a,$b) == 0;
 	} else {
 		return $a == $b;
 	}
@@ -815,7 +817,13 @@ class ShippingRule {
 
 	function parseShippingTerm($expr) {
 		/* In the advanced version, shipping cost can be given as a full mathematical expression */
-		return strtolower($expr);
+		// If the shipping term starts with a double quote, it is a string, so don't turn it into lowercase.
+		// All other expressions need to be turned into lowercase, because variable names are case-insensitive!
+		if (substr($expr, 0, 1) === '"') {
+			return $expr;
+		} else {
+			return strtolower($expr);
+		}
 	}
 	
 	function evaluateComparison ($terms, $vals) {