diff --git a/js/models/AppState.js b/js/models/AppState.js
index c7f6c17a28bab4bc4dbf63db749c7c5188416999..e42ff88f5f70fec0da1f76857492e2aafc43896e 100644
--- a/js/models/AppState.js
+++ b/js/models/AppState.js
@@ -8,7 +8,7 @@
 AppState = Backbone.Model.extend({
 
     defaults: {
-        currentNav:"navDesign",//design, sim, assemble
+        currentNav:"navDesign",// design, sim, assemble
         currentTab:"lattice",
 
         //last tab that one open in each of the main menus
diff --git a/js/models/Lattice.js b/js/models/Lattice.js
index 35398388e2a8c5d736045fcabce17dea7fd70a4e..d2504c5f4084ade6b88180c4808afdbef1f16177 100644
--- a/js/models/Lattice.js
+++ b/js/models/Lattice.js
@@ -94,6 +94,7 @@ Lattice = Backbone.Model.extend({
     },
 
     removeCell: function(cell){
+        if (!cell) return;
         var index = this._subtract(cell.indices, this.get("cellsMin"));
         var cells = this.get("cells");
         cell.destroy();