diff --git a/background.js b/background.js
index 84ac06bd..fcd74f07 100644
--- a/background.js
+++ b/background.js
@@ -198,12 +198,12 @@ function saveStyle(o, callback) {
 				}
 			} else {
 				// create a new record
-				if (!("updateUrl" in o)) {
-					o.updateUrl = null;
-				}
-				if (!("md5Url" in o)) {
-					o.md5Url = null;
-				}
+				// set optional things to null if they're undefined
+				["updateUrl", "md5Url", "url"].filter(function(att) {
+					return !(att in o);
+				}).forEach(function(att) {
+					o[att] = null;
+				});
 				t.executeSql('INSERT INTO styles (name, enabled, url, updateUrl, md5Url) VALUES (?, ?, ?, ?, ?);', [o.name, true, o.url, o.updateUrl, o.md5Url]);
 			}
 
diff --git a/storage.js b/storage.js
index 3ee901bc..e774482f 100644
--- a/storage.js
+++ b/storage.js
@@ -11,6 +11,8 @@ function getDatabase(ready, error) {
 		dbV12(stylishDb, error, ready);
 	} else if (stylishDb.version == "1.2") {
 		dbV13(stylishDb, error, ready);
+	} else if (stylishDb.version == "1.3") {
+		dbV14(stylishDb, error, ready);
 	} else {
 	  ready(stylishDb);
 	}
@@ -51,6 +53,12 @@ function dbV13(d, error, done) {
 	}, error, function() { done(d)});
 }
 
+function dbV14(d, error, done) {
+	d.changeVersion(d.version, '1.4', function (t) {
+		t.executeSql('UPDATE styles SET url = null WHERE url = "undefined";');
+	}, error, function() { done(d)});
+}
+
 function enableStyle(id, enabled) {
 	getDatabase(function(db) {
 		db.transaction(function (t) {