Index: src/sas/qtgui/Utilities/GuiUtils.py
===================================================================
--- src/sas/qtgui/Utilities/GuiUtils.py	(revision 57be490d989c9a52dd3d902191267a861890a9ef)
+++ src/sas/qtgui/Utilities/GuiUtils.py	(revision c5e0d844708c4a7f2071bbba6132d4b2a67ce73a)
@@ -1014,5 +1014,5 @@
     # The following return needs to be removed once
     # the unittest related changes in Sasmodels are commited
-    return True
+    # return True
     # try running the model
     from sasmodels.sasview_model import load_custom_model
Index: src/sas/qtgui/Utilities/PluginDefinition.py
===================================================================
--- src/sas/qtgui/Utilities/PluginDefinition.py	(revision 26970b3780381fa0bceb5820f27d9e321d8b0a6e)
+++ src/sas/qtgui/Utilities/PluginDefinition.py	(revision c5e0d844708c4a7f2071bbba6132d4b2a67ce73a)
@@ -36,9 +36,8 @@
         self.addWidgets()
 
-    def addWidgets(self):
+    def addTooltip(self):
         """
-        Initialize various widgets in the dialog
+        Add the default tooltip to the text field
         """
-        # Set the tooltip
         hint_function = "#Example:\n\n"
         hint_function += "if x <= 0:\n"
@@ -48,4 +47,11 @@
         hint_function += "return y\n"
         self.txtFunction.setToolTip(hint_function)
+
+    def addWidgets(self):
+        """
+        Initialize various widgets in the dialog
+        """
+        self.addTooltip()
+
         # Initial text in the function table
         text = \
@@ -154,4 +160,5 @@
         # keep in mind that this is called every time the text changes.
         # mind the performance!
+        self.addTooltip()
         self.model['text'] = self.txtFunction.toPlainText().lstrip().rstrip()
         self.modelModified.emit()
Index: src/sas/qtgui/Utilities/TabbedModelEditor.py
===================================================================
--- src/sas/qtgui/Utilities/TabbedModelEditor.py	(revision f9214aa2fb27946f8caddaff6f61e30d016bda8e)
+++ src/sas/qtgui/Utilities/TabbedModelEditor.py	(revision c5e0d844708c4a7f2071bbba6132d4b2a67ce73a)
@@ -77,4 +77,5 @@
         self.cmdLoad.clicked.connect(self.onLoad)
         # signals from tabs
+        self.plugin_widget.modelModified.connect(self.editorModelModified)
         self.editor_widget.modelModified.connect(self.editorModelModified)
         self.plugin_widget.txtName.editingFinished.connect(self.pluginTitleSet)
@@ -170,4 +171,5 @@
         """
         self.setTabEdited(True)
+        self.plugin_widget.txtFunction.setStyleSheet("")
         self.buttonBox.button(QtWidgets.QDialogButtonBox.Apply).setEnabled(True)
         self.is_modified = True
@@ -237,10 +239,43 @@
         self.writeFile(full_path, model_str)
 
+        # disable "Apply"
+        self.buttonBox.button(QtWidgets.QDialogButtonBox.Apply).setEnabled(False)
         # test the model
 
         # Run the model test in sasmodels
+        if not self.isModelCorrect(full_path):
+            return
+
+        self.editor_widget.setEnabled(True)
+
+        # Update the editor here.
+        # Simple string forced into control.
+        self.editor_widget.blockSignals(True)
+        self.editor_widget.txtEditor.setPlainText(model_str)
+        self.editor_widget.blockSignals(False)
+
+        # Set the widget title
+        self.setTabEdited(False)
+
+        # Notify listeners
+        self.parent.communicate.customModelDirectoryChanged.emit()
+
+        # Notify the user
+        msg = "Custom model "+filename + " successfully created."
+        self.parent.communicate.statusBarUpdateSignal.emit(msg)
+        logging.info(msg)
+
+    def isModelCorrect(self, full_path):
+        """
+        Run the sasmodels method for model check
+        and return True if the model is good.
+        False otherwise.
+        """
+        successfulCheck = True
         try:
             model_results = GuiUtils.checkModel(full_path)
             logging.info(model_results)
+        # We can't guarantee the type of the exception coming from
+        # Sasmodels, so need the overreaching general Exception
         except Exception as ex:
             msg = "Error building model: "+ str(ex)
@@ -252,25 +287,17 @@
             logging.error(traceback_to_show)
 
+            # Set the status bar message
             self.parent.communicate.statusBarUpdateSignal.emit("Model check failed")
-            return
-
-        self.editor_widget.setEnabled(True)
-
-        # Update the editor here.
-        # Simple string forced into control.
-        self.editor_widget.blockSignals(True)
-        self.editor_widget.txtEditor.setPlainText(model_str)
-        self.editor_widget.blockSignals(False)
-
-        # Set the widget title
-        self.setTabEdited(False)
-
-        # Notify listeners
-        self.parent.communicate.customModelDirectoryChanged.emit()
-
-        # Notify the user
-        msg = "Custom model "+filename + " successfully created."
-        self.parent.communicate.statusBarUpdateSignal.emit(msg)
-        logging.info(msg)
+
+            # Remove the file so it is not being loaded on refresh
+            os.remove(full_path)
+            # Put a thick, red border around the mini-editor
+            self.plugin_widget.txtFunction.setStyleSheet("border: 5px solid red")
+            # Use the last line of the traceback for the tooltip
+            last_lines = traceback.format_exc().split('\n')[-2:]
+            traceback_to_show = '\n'.join(last_lines)
+            self.plugin_widget.txtFunction.setToolTip(traceback_to_show)
+            successfulCheck = False
+        return successfulCheck
 
     def updateFromEditor(self):
