Index: build_tools/jenkins_linux_build.sh
===================================================================
--- build_tools/jenkins_linux_build.sh	(revision 8ca1ba155e3a0b2b6edf2b316be50af7099cb900)
+++ build_tools/jenkins_linux_build.sh	(revision 128c2872f997a4739e0f79db0844701148e2b0a0)
@@ -37,5 +37,5 @@
 cd sasmodels
 $PYTHON setup.py bdist_egg
-
+$PYTHON -m sasmodels.model_test all
 
 # SASVIEW
Index: build_tools/jenkins_osx_build.sh
===================================================================
--- build_tools/jenkins_osx_build.sh	(revision 8ca1ba155e3a0b2b6edf2b316be50af7099cb900)
+++ build_tools/jenkins_osx_build.sh	(revision b742b8b5131a7ad28d28cdcc9d38afeba1468dc5)
@@ -37,8 +37,9 @@
 make html
 
+#SASMODELS - BUILDING AND TESTING
 cd $WORKSPACE
 cd sasmodels
 $PYTHON setup.py bdist_egg
-
+$PYTHON -m sasmodels.model_test all
 
 # SASVIEW
Index: build_tools/jenkins_win64_build.bat
===================================================================
--- build_tools/jenkins_win64_build.bat	(revision b636c0ba19251c36d3e77865a7473f67e3af4a41)
+++ build_tools/jenkins_win64_build.bat	(revision ec57735fbfe1015c0d19979bac87b58960f4ba4a)
@@ -47,4 +47,5 @@
 cd sasmodels
 %PYTHON% setup.py bdist_egg
+%PYTHON% -m sasmodels.model_test all
 
 :: SASMODELS install egg ##############################################
Index: build_tools/jenkins_win_build.bat
===================================================================
--- build_tools/jenkins_win_build.bat	(revision 801a2968ae0b500c87588ecf8a8bd3c52546b4ee)
+++ build_tools/jenkins_win_build.bat	(revision 5dab2bcf8bad4724649332fd97b3f40bf2d549cf)
@@ -48,5 +48,5 @@
 cd sasmodels
 %PYTHON% setup.py bdist_egg
-
+%PYTHON% -m sasmodels.model_test all
 
 :: SASMODELS install egg ##############################################
Index: sasview/sasview.spec
===================================================================
--- sasview/sasview.spec	(revision e42c8e9da0efedb482d84a029b0a02f1e865fa34)
+++ sasview/sasview.spec	(revision e42c8e9da0efedb482d84a029b0a02f1e865fa34)
@@ -0,0 +1,182 @@
+# -*- mode: python -*-
+# Modifiable location
+import sys
+import os
+import platform
+
+import warnings
+from distutils.filelist import findall
+
+PYTHON_LOC = sys.exec_prefix
+# Portability settings
+if os.name == 'posix':
+    LIBPREFIX='lib'
+    LIBSUFFIX='so'
+    LIBLOC = os.path.join(PYTHON_LOC,'lib')
+    # Darwin needs UPX=False, Linux actually builds with both...
+    if platform.system() == 'Darwin':
+        UPX=False
+    else:
+        UPX=True
+else:
+    LIBPREFIX=''
+    LIBSUFFIX='dll'
+    LIBLOC = os.path.join(PYTHON_LOC,'Library','bin')
+    UPX=True
+
+SCRIPT_TO_SOURCE = 'sasview.py'
+
+# Warning! pyinstaller/py2exe etc. don't have the __file__ attribute
+# WORK_DIR = os.path.dirname(os.path.realpath(__file__))
+WORK_DIR = os.path.dirname(os.path.realpath(sys.argv[0]))
+
+#### LOCAL METHODS
+def add_data(data):
+    for component in data:
+        target = component[0]
+        for filename in component[1]:
+           datas.append((filename, target))
+
+def add_binary(binary):
+    return (os.path.join(LIBLOC,binary),'.')
+
+# ADDITIONAL DATA ############################################################
+datas = [('images', 'images')]
+
+datas.append(('media','media'))
+datas.append(('test','test'))
+datas.append(('custom_config.py','.'))
+datas.append(('local_config.py','.'))
+datas.append(('wxcruft.py','.'))
+datas.append(('welcome_panel.py','.'))
+
+# TODO
+# NEED BETTER WAY TO DEAL WITH THESE RELATIVE PATHS
+datas.append((os.path.join('..','..','sasmodels','sasmodels'),'sasmodels'))
+datas.append((os.path.join('..','src','sas','sasgui','perspectives','fitting','plugin_models'),'plugin_models'))
+
+# precompile sas models into the sasview build path; doesn't matter too much
+# where it is so long as it is a place that will get cleaned up afterwards.
+import sasmodels.core
+dll_path = 'compiled_models'
+if not (os.path.exists(dll_path)):
+    os.mkdir(dll_path)
+dll_path2 = os.path.join(dll_path, dll_path)
+if not (os.path.exists(dll_path2)):
+    os.mkdir(dll_path2)
+
+compiled_dlls = sasmodels.core.precompile_dlls(dll_path, dtype='double')
+
+# include the compiled models as data; coordinate the target path for the
+# data with installer_generator.py
+datas.append((os.path.join('compiled_models','compiled_models'),'compiled_models'))
+
+# These depend on whether we have MKL or Atlas numpy
+if os.path.exists(os.path.join(LIBLOC, LIBPREFIX + 'mkl_core.' + LIBSUFFIX)):
+    datas.append(add_binary(LIBPREFIX + 'mkl_avx2.' + LIBSUFFIX))
+    datas.append(add_binary(LIBPREFIX + 'mkl_def.' + LIBSUFFIX))
+elif os.path.exists(os.path.join(LIBLOC, LIBPREFIX + 'numpy-atlas.' + LIBSUFFIX)):
+    datas.append(add_binary(LIBPREFIX + 'numpy-atlas.' + LIBSUFFIX))
+else:
+    raise Exception("No numerical library for numpy found.")
+
+import sas.sascalc.dataloader.readers
+f = os.path.join(sas.sascalc.dataloader.readers.get_data_path(), 'defaults.json')
+datas.append((f, '.'))
+
+# Add a custom pyopencl hook, as described in
+# https://github.com/pyinstaller/pyinstaller/issues/2130
+from PyInstaller.utils.hooks import copy_metadata
+datas.append(copy_metadata('pyopencl')[0])
+
+import sasmodels
+add_data(sasmodels.data_files())
+
+try:
+    import tinycc
+    add_data(tinycc.data_files())
+except ImportError:
+    warnings.warn("TinyCC package is not available and will not be included")
+
+import periodictable
+add_data(periodictable.data_files())
+
+import matplotlib
+matplotlibdatadir = matplotlib.get_data_path()
+matplotlibdata = findall(matplotlibdatadir)
+for f in matplotlibdata:
+    dirname = os.path.join('mpl-data', f[len(matplotlibdatadir)+1:])
+    datas.append((f, os.path.split(dirname)[0]))
+
+binaries = []
+
+# EXCLUDED FILES ############################################################
+# Spelled out to enable easier editing
+excludes = []
+excludes.append('libzmq')
+excludes.append('IPython')
+excludes.append('PyQt4')
+excludes.append('PySide')
+excludes.append('Qt4')
+excludes.append('Tkinter')
+excludes.append('tk')
+excludes.append('tcl')
+# Seems we cannot build on Linux without bundling sip
+if not platform.system() == 'Linux':
+    excludes.append('sip')
+excludes.append('sympy')
+excludes.append('pytz')
+excludes.append('sklearn')
+excludes.append('zmq')
+
+# Need to explicitly exclude sasmodels here!!
+excludes.append('sasmodels')
+
+# HIDDEN MODULES ############################################################
+hiddenimports = [
+ 'periodictable.core',
+ 'sasmodels.core',
+ 'pyopencl',
+ 'tinycc'
+]
+
+a = Analysis([SCRIPT_TO_SOURCE],
+             pathex=[WORK_DIR],
+             binaries=binaries,
+             datas=datas,
+             hiddenimports=hiddenimports,
+             hookspath=[],
+             runtime_hooks=[],
+             excludes=excludes,
+             win_no_prefer_redirects=False,
+             win_private_assemblies=False,
+             cipher=None)
+
+pyz = PYZ(a.pure, a.zipped_data,
+             cipher=None)
+
+exe = EXE(pyz,
+          a.scripts,
+          exclude_binaries=True,
+          name='sasview',
+          debug=False,
+          upx=UPX,
+          icon=os.path.join("images","ball.ico"),
+          version="version.txt",
+          console=False )
+
+# COLLECT creates a directory instead of a single file.
+coll = COLLECT(exe,
+               a.binaries,
+               a.zipfiles,
+               a.datas,
+               strip=False,
+               upx=UPX,
+               name='sasview')
+
+if platform.system() == 'Darwin':
+    app = BUNDLE(exe,
+        name='SasView.app',
+        icon='images/ball.ico',
+        bundle_identifier=None)
+
Index: sasview/version.txt
===================================================================
--- sasview/version.txt	(revision e42c8e9da0efedb482d84a029b0a02f1e865fa34)
+++ sasview/version.txt	(revision e42c8e9da0efedb482d84a029b0a02f1e865fa34)
@@ -0,0 +1,44 @@
+# UTF-8
+#
+# For more details about fixed file info 'ffi' see:
+# http://msdn.microsoft.com/en-us/library/ms646997.aspx
+VSVersionInfo(
+  ffi=FixedFileInfo(
+    # filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
+    # Set not needed items to zero 0.
+    filevers=(0, 0, 0, 0),
+    prodvers=(4, 1, 0, 0),
+    # Contains a bitmask that specifies the valid bits 'flags'
+    mask=0x3f,
+    # Contains a bitmask that specifies the Boolean attributes of the file.
+    flags=0x0,
+    # The operating system for which this file was designed.
+    # 0x4 - NT and there is no need to change it.
+    OS=0x4,
+    # The general type of file.
+    # 0x1 - the file is an application.
+    fileType=0x1,
+    # The function of the file.
+    # 0x0 - the function is not defined for this fileType
+    subtype=0x0,
+    # Creation date and time stamp.
+    date=(0, 0)
+    ),
+  kids=[
+    StringFileInfo(
+      [
+      StringTable(
+        u'040904b0',
+        [StringStruct(u'CompanyName', u'SAS Community Project'),
+        StringStruct(u'ProductName', u'SasView'),
+        StringStruct(u'ProductVersion', u'4, 0, 0, 0'),
+        StringStruct(u'InternalName', u'SasView'),
+        StringStruct(u'OriginalFilename', u'sasview.exe'),
+        StringStruct(u'FileVersion', u'96, 12, 19, 1'),
+        StringStruct(u'FileDescription', u'SasView'),
+        StringStruct(u'LegalCopyright', u'Free'),])
+      ]),
+    VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
+  ]
+)
+
Index: src/sas/sascalc/dataloader/manipulations.py
===================================================================
--- src/sas/sascalc/dataloader/manipulations.py	(revision b699768550de9d4b35b087234ec1d2a461922bab)
+++ src/sas/sascalc/dataloader/manipulations.py	(revision b2b3693291d8e49fd33718753161206c1964548c)
@@ -143,5 +143,5 @@
         :return: Data1D object
         """
-        if len(data2D.detector) != 1:
+        if len(data2D.detector) > 1:
             msg = "_Slab._avg: invalid number of "
             msg += " detectors: %g" % len(data2D.detector)
@@ -299,5 +299,5 @@
             error on number of counts, number of entries summed
         """
-        if len(data2D.detector) != 1:
+        if len(data2D.detector) > 1:
             msg = "Circular averaging: invalid number "
             msg += "of detectors: %g" % len(data2D.detector)
Index: src/sas/sascalc/dataloader/readers/ascii_reader.py
===================================================================
--- src/sas/sascalc/dataloader/readers/ascii_reader.py	(revision 7d94915074e1688fc87991152ae32ccfce9987f4)
+++ src/sas/sascalc/dataloader/readers/ascii_reader.py	(revision d2471870e414a3166a1caa621a5cf27a07cacb6d)
@@ -172,5 +172,6 @@
                 input_f.close()
                 if not is_data:
-                    return None
+                    msg = "ascii_reader: x has no data"
+                    raise RuntimeError, msg
                 # Sanity check
                 if has_error_dy == True and not len(ty) == len(tdy):
Index: src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py
===================================================================
--- src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py	(revision 5e9062071eef0080f51c5de4c3cfb3bb129ebab6)
+++ src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py	(revision bbd0f37aa83b3764868742835a730122ba826585)
@@ -162,4 +162,7 @@
                     else:
                         self.current_dataset.x = data_set.flatten()
+                    continue
+                elif key == u'Qdev':
+                    self.current_dataset.dx = data_set.flatten()
                     continue
                 elif key == u'Qy':
Index: src/sas/sascalc/fit/BumpsFitting.py
===================================================================
--- src/sas/sascalc/fit/BumpsFitting.py	(revision b699768550de9d4b35b087234ec1d2a461922bab)
+++ src/sas/sascalc/fit/BumpsFitting.py	(revision 345e7e4a8c6f5977c8c07032553b5ab00bdf837d)
@@ -4,4 +4,5 @@
 import os
 from datetime import timedelta, datetime
+import traceback
 
 import numpy
@@ -293,6 +294,9 @@
             R.success = result['success']
             if R.success:
-                R.stderr = numpy.hstack((result['stderr'][fitted_index],
-                                         numpy.NaN*numpy.ones(len(fitness.computed_pars))))
+                if result['stderr'] is None:
+                    R.stderr = numpy.NaN*numpy.ones(len(param_list))
+                else:
+                    R.stderr = numpy.hstack((result['stderr'][fitted_index],
+                                             numpy.NaN*numpy.ones(len(fitness.computed_pars))))
                 R.pvec = numpy.hstack((result['value'][fitted_index],
                                       [p.value for p in fitness.computed_pars]))
@@ -306,4 +310,5 @@
                 R.uncertainty_state = result['uncertainty']
             all_results.append(R)
+        all_results[0].mesg = result['errors']
 
         if q is not None:
@@ -344,7 +349,8 @@
     try:
         best, fbest = fitdriver.fit()
-    except:
-        import traceback; traceback.print_exc()
-        raise
+        errors = []
+    except Exception as exc:
+        best, fbest = None, numpy.NaN
+        errors = [str(exc), traceback.traceback.format_exc()]
     finally:
         mapper.stop_mapper(fitdriver.mapper)
@@ -356,10 +362,17 @@
 
     success = best is not None
+    try:
+        stderr = fitdriver.stderr() if success else None
+    except Exception as exc:
+        errors.append(str(exc))
+        errors.append(traceback.format_exc())
+        stderr = None
     return {
         'value': best if success else None,
-        'stderr': fitdriver.stderr() if success else None,
+        'stderr': stderr,
         'success': success,
         'convergence': convergence,
         'uncertainty': getattr(fitdriver.fitter, 'state', None),
+        'errors': '\n'.join(errors),
         }
 
Index: src/sas/sasgui/guiframe/gui_manager.py
===================================================================
--- src/sas/sasgui/guiframe/gui_manager.py	(revision c8e19964f2dda929ccae8237e7b140a906cdf134)
+++ src/sas/sasgui/guiframe/gui_manager.py	(revision 67b0a99ce9f69a9dfef035e8e4a06588c9f1602f)
@@ -1950,5 +1950,4 @@
                     item, _, _ = value
                     item.Check(True)
-            self._data_panel.on_remove(None, False)
 
             wx.PostEvent(self, StatusEvent(status="Loading Project file..."))
@@ -1963,4 +1962,5 @@
                 # Reset to a base state
                 self._on_reset_state()
+                self._data_panel.on_remove(None, False)
                 # Load the project file
                 self.load_state(path=path, is_project=True)
@@ -2456,5 +2456,4 @@
                                                 group_id=group_id,
                                                 action='remove'))
-                # remove res plot: Todo: improve
                 wx.CallAfter(self._remove_res_plot, new_plot.id)
         self._data_manager.delete_data(data_id=data_id,
Index: src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py
===================================================================
--- src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py	(revision 1a696bf1c7cb0055c4025dc8d0871e1842e4c1a0)
+++ src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py	(revision b2b3693291d8e49fd33718753161206c1964548c)
@@ -316,5 +316,5 @@
 
         slicerpop.AppendSeparator()
-        if len(self.data2D.detector) == 1:
+        if len(self.data2D.detector) <= 1:
             item_list = self.parent.get_current_context_menu(self)
             if (not item_list == None) and (not len(item_list) == 0) and\
Index: src/sas/sasgui/perspectives/fitting/basepage.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/basepage.py	(revision 99f3e05352e0aa478ae2afe28c19c8a87dcff6d4)
+++ src/sas/sasgui/perspectives/fitting/basepage.py	(revision 345e7e4a8c6f5977c8c07032553b5ab00bdf837d)
@@ -1532,4 +1532,5 @@
                         val = len(val) if isinstance(val, list) else 1
                         self.Npts_fit.SetValue(str(val))
+
                     else:
                         # No data in the panel
Index: src/sas/sasgui/perspectives/fitting/fitpanel.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/fitpanel.py	(revision c8e19964f2dda929ccae8237e7b140a906cdf134)
+++ src/sas/sasgui/perspectives/fitting/fitpanel.py	(revision 67b0a99ce9f69a9dfef035e8e4a06588c9f1602f)
@@ -189,10 +189,9 @@
         # use while-loop, for-loop will not do the job well.
         while (self.GetPageCount() > 0):
-            # delete the first page until no page exists
-            page = self.GetPage(0)
+            page = self.GetPage(self.GetPageCount() - 1)
             if self._manager.parent.panel_on_focus == page:
                 self._manager.parent.panel_on_focus = None
             self._close_helper(selected_page=page)
-            self.DeletePage(0)
+            self.DeletePage(self.GetPageCount() - 1)
         # Clear list of names
         self.fit_page_name = {}
@@ -400,4 +399,13 @@
                     temp = self.GetSelection()
                     self.DeletePage(temp)
+            if self.sim_page is not None:
+                if len(self.sim_page.model_list) == 0:
+                    pos = self.GetPageIndex(self.sim_page)
+                    self.SetSelection(pos)
+                    self.on_close_page(event=None)
+                    temp = self.GetSelection()
+                    self.DeletePage(temp)
+                    self.sim_page = None
+                    self.batch_on = False
             if self.GetPageCount() == 0:
                 self._manager.on_add_new_page(event=None)
Index: src/sas/sasgui/perspectives/fitting/fitting.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/fitting.py	(revision ec72ceb76f0f8f97a43694dd5647f5a51b5c8b26)
+++ src/sas/sasgui/perspectives/fitting/fitting.py	(revision 1a5d5f2d6cd4b4999b40c7fbc72a7a295fa78d9d)
@@ -1521,11 +1521,10 @@
             for uid in page_id:
                 res = result[index]
+                fit_msg = res.mesg
                 if res.fitness is None or \
                     not numpy.isfinite(res.fitness) or \
                     numpy.any(res.pvec == None) or \
                     not numpy.all(numpy.isfinite(res.pvec)):
-                    msg = "Fitting did not converge!!!"
-                    evt = StatusEvent(status=msg, info="warning", type="stop")
-                    wx.PostEvent(self.parent, evt)
+                    fit_msg += "\nFitting did not converge!!!"
                     wx.CallAfter(self._update_fit_button, page_id)
                 else:
@@ -1550,11 +1549,10 @@
                         wx.CallAfter(cpage._on_fit_complete)
                     except KeyboardInterrupt:
-                        msg = "Singular point: Fitting Stoped."
-                        evt = StatusEvent(status=msg, info="info", type="stop")
-                        wx.PostEvent(self.parent, evt)
+                        fit_msg += "\nSingular point: Fitting stopped."
                     except:
-                        msg = "Singular point: Fitting Error occurred."
-                        evt = StatusEvent(status=msg, info="error", type="stop")
-                        wx.PostEvent(self.parent, evt)
+                        fit_msg += "\nSingular point: Fitting error occurred."
+                if fit_msg:
+                   evt = StatusEvent(status=fit_msg, info="warning", type="stop")
+                   wx.PostEvent(self.parent, evt)
 
         except:
Index: src/sas/sasgui/perspectives/fitting/media/plugin.rst
===================================================================
--- src/sas/sasgui/perspectives/fitting/media/plugin.rst	(revision 20cfa239f017ea05584938bfdc4562662d333702)
+++ src/sas/sasgui/perspectives/fitting/media/plugin.rst	(revision ca1eaeb12bda1f5fddeae63947586d004c774769)
@@ -560,5 +560,5 @@
 
     M_PI_180, M_4PI_3:
-        $\pi/{180}$, $\tfrac{4}{3}\pi$
+        $\frac{\pi}{180}$, $\frac{4\pi}{3}$
     SINCOS(x, s, c):
         Macro which sets s=sin(x) and c=cos(x). The variables *c* and *s*
@@ -596,71 +596,133 @@
 These functions have been tuned to be fast and numerically stable down
 to $q=0$ even in single precision.  In some cases they work around bugs
-which appear on some platforms but not others. So use them where needed!!!
+which appear on some platforms but not others, so use them where needed.
+Add the files listed in :code:`source = ["lib/file.c", ...]` to your *model.py*
+file in the order given, otherwise these functions will not be available.
 
     polevl(x, c, n):
-        Polynomial evaluation $p(x) = \sum_{i=0}^n c_i x^{n-i}$ using Horner's
+        Polynomial evaluation $p(x) = \sum_{i=0}^n c_i x^i$ using Horner's
         method so it is faster and more accurate.
 
+        $c = \{c_n, c_{n-1}, \ldots, c_0 \}$ is the table of coefficients,
+        sorted from highest to lowest.
+
+        :code:`source = ["lib/polevl.c", ...]` (`link to code <https://github.com/SasView/sasmodels/tree/master/sasmodels/models/lib/polevl.c>`_)
+
+    p1evl(x, c, n):
+        Evaluation of normalized polynomial $p(x) = x^n + \sum_{i=0}^{n-1} c_i x^i$
+        using Horner's method so it is faster and more accurate.
+
+        $c = \{c_{n-1}, c_{n-2} \ldots, c_0 \}$ is the table of coefficients,
+        sorted from highest to lowest.
+
         :code:`source = ["lib/polevl.c", ...]`
-
-    sas_gamma:
-        Gamma function $\text{sas_gamma}(x) = \Gamma(x)$.  The standard math
-        library gamma function, tgamma(x) is unstable below 1 on some platforms.
+        (`link to code <https://github.com/SasView/sasmodels/tree/master/sasmodels/models/lib/polevl.c>`_)
+
+    sas_gamma(x):
+        Gamma function $\text{sas_gamma}(x) = \Gamma(x)$.
+
+        The standard math function, tgamma(x) is unstable for $x < 1$
+        on some platforms.
 
         :code:`source = ["lib/sasgamma.c", ...]`
-
-    erf, erfc:
+        (`link to code <https://github.com/SasView/sasmodels/tree/master/sasmodels/models/lib/sas_gamma.c>`_)
+
+    sas_erf(x), sas_erfc(x):
         Error function
-        $\text{erf}(x) = \frac{1}{\sqrt\pi}\int_0^x e^{-t^2}\,dt$
+        $\text{sas_erf}(x) = \frac{2}{\sqrt\pi}\int_0^x e^{-t^2}\,dt$
         and complementary error function
-        $\text{erfc}(x) = \frac{1}{\sqrt\pi}\int_x^\inf e^{-t^2}\,dt$.
-        The standard math library erf and erfc are slower and broken
+        $\text{sas_erfc}(x) = \frac{2}{\sqrt\pi}\int_x^{\infty} e^{-t^2}\,dt$.
+
+        The standard math functions erf(x) and erfc(x) are slower and broken
         on some platforms.
 
         :code:`source = ["lib/polevl.c", "lib/sas_erf.c", ...]`
-
-    sas_J0:
-        Bessel function of the first kind where
+        (`link to error functions' code <https://github.com/SasView/sasmodels/tree/master/sasmodels/models/lib/sas_erf.c>`_)
+
+    sas_J0(x):
+        Bessel function of the first kind $\text{sas_J0}(x)=J_0(x)$ where
         $J_0(x) = \frac{1}{\pi}\int_0^\pi \cos(x\sin(\tau))\,d\tau$.
 
+        The standard math function j0(x) is not available on all platforms.
+
         :code:`source = ["lib/polevl.c", "lib/sas_J0.c", ...]`
-
-    sas_J1:
-        Bessel function of the first kind where
+        (`link to Bessel function's code <https://github.com/SasView/sasmodels/tree/master/sasmodels/models/lib/sas_J0.c>`_)
+
+    sas_J1(x):
+        Bessel function of the first kind  $\text{sas_J1}(x)=J_1(x)$ where
         $J_1(x) = \frac{1}{\pi}\int_0^\pi \cos(\tau - x\sin(\tau))\,d\tau$.
 
+        The standard math function j1(x) is not available on all platforms.
+
         :code:`source = ["lib/polevl.c", "lib/sas_J1.c", ...]`
-
-    sas_JN:
-        Bessel function of the first kind where
+        (`link to Bessel function's code <https://github.com/SasView/sasmodels/tree/master/sasmodels/models/lib/sas_J1.c>`_)
+
+    sas_JN(n, x):
+        Bessel function of the first kind and integer order $n$:
+        $\text{sas_JN}(n, x)=J_n(x)$ where
         $J_n(x) = \frac{1}{\pi}\int_0^\pi \cos(n\tau - x\sin(\tau))\,d\tau$.
+        If $n$ = 0 or 1, it uses sas_J0(x) or sas_J1(x), respectively.
+
+        The standard math function jn(n, x) is not available on all platforms.
 
         :code:`source = ["lib/polevl.c", "lib/sas_J0.c", "lib/sas_J1.c", "lib/sas_JN.c", ...]`
-
-    Si:
+        (`link to Bessel function's code <https://github.com/SasView/sasmodels/tree/master/sasmodels/models/lib/sas_JN.c>`_)
+
+    Si(x):
         Sine integral $\text{Si}(x) = \int_0^x \tfrac{\sin t}{t}\,dt$.
 
-        :code:`soure = ["lib/Si.c", ...]`
-
-    sph_j1c(qr):
+        This function uses Taylor series for small and large arguments:
+
+        For large arguments,
+
+        .. math::
+
+             \text{Si}(x) \sim \frac{\pi}{2}
+             - \frac{\cos(x)}{x}\left(1 - \frac{2!}{x^2} + \frac{4!}{x^4} - \frac{6!}{x^6} \right)
+             - \frac{\sin(x)}{x}\left(\frac{1}{x} - \frac{3!}{x^3} + \frac{5!}{x^5} - \frac{7!}{x^7}\right)
+
+        For small arguments,
+
+        .. math::
+
+           \text{Si}(x) \sim x
+           - \frac{x^3}{3\times 3!} + \frac{x^5}{5 \times 5!} - \frac{x^7}{7 \times 7!}
+           + \frac{x^9}{9\times 9!} - \frac{x^{11}}{11\times 11!}
+
+        :code:`source = ["lib/Si.c", ...]`
+        (`link to code <https://github.com/SasView/sasmodels/tree/master/sasmodels/models/lib/Si.c>`_)
+
+    sph_j1c(x):
         Spherical Bessel form
-        $F(qr) = 3 j_1(qr)/(qr) = 3 (\sin(qr) - qr \cos(qr))/{(qr)^3}$,
-        with a limiting value of 1 at $qr=0$.  This function uses a Taylor
-        series for small $qr$ for numerical accuracy.
+        $\text{sph_j1c}(x) = 3 j_1(x)/x = 3 (\sin(x) - x \cos(x))/x^3$,
+        with a limiting value of 1 at $x=0$, where $j_1(x)$ is the spherical
+        Bessel function of the first kind and first order.
+
+        This function uses a Taylor series for small $x$ for numerical accuracy.
 
         :code:`source = ["lib/sph_j1c.c", ...]`
-
-    sas_J1c(qr):
-        Bessel form $F(qr) = 2 J_1(qr)/{(qr)}$, with a limiting value of 1 at $qr=0$.
+        (`link to code <https://github.com/SasView/sasmodels/tree/master/sasmodels/models/lib/sph_j1c.c>`_)
+
+
+    sas_J1c(x):
+        Bessel form $\text{sas_J1c}(x) = 2 J_1(x)/x$, with a limiting value
+        of 1 at $x=0$, where $J_1(x)$ is the Bessel function of first kind
+        and first order.
 
         :code:`source = ["lib/polevl.c", "lib/sas_J1.c", ...]`
-
-    Gauss76z[i], Gauss76Wt[i]:
-        Points $z_i$ and weights $w_i$ for 76-point Gaussian quadrature,
-        computing $\int_{-1}^1 f(z)\,dz \approx \sum_{i=1}^{76} w_i f(z_i)$.
-        Similar arrays are available in :code:`gauss20.c` for 20 point
-        quadrature and in :code:`gauss150.c` for 150 point quadrature.
-
-        :code:`source = ["gauss76.c", ...]`
+        (`link to Bessel form's code <https://github.com/SasView/sasmodels/tree/master/sasmodels/models/lib/sas_J1.c>`_)
+
+
+    Gauss76Z[i], Gauss76Wt[i]:
+        Points $z_i$ and weights $w_i$ for 76-point Gaussian quadrature, respectively,
+        computing $\int_{-1}^1 f(z)\,dz \approx \sum_{i=1}^{76} w_i\,f(z_i)$.
+
+        Similar arrays are available in :code:`gauss20.c` for 20-point
+        quadrature and in :code:`gauss150.c` for 150-point quadrature.
+
+        :code:`source = ["lib/gauss76.c", ...]`
+        (`link to code <https://github.com/SasView/sasmodels/tree/master/sasmodels/models/lib/gauss76.c>`_)
+
+
 
 Problems with C models
Index: src/sas/sasgui/perspectives/invariant/media/invariant_help.rst
===================================================================
--- src/sas/sasgui/perspectives/invariant/media/invariant_help.rst	(revision b64b87c874ab0edc565e9c415decc839e3214c8c)
+++ src/sas/sasgui/perspectives/invariant/media/invariant_help.rst	(revision 484141c7d5e50aeda61f3fe22bc28452ee9c344e)
@@ -116,5 +116,5 @@
 Academic Press, New York, 1982
 
-http://physchem.kfunigraz.ac.at/sm/
+http://web.archive.org/web/20110824105537/http://physchem.kfunigraz.ac.at/sm/Service/Glatter_Kratky_SAXS_1982.zip
 
 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
Index: test/sasdataloader/test/utest_ascii.py
===================================================================
--- test/sasdataloader/test/utest_ascii.py	(revision 7d94915074e1688fc87991152ae32ccfce9987f4)
+++ test/sasdataloader/test/utest_ascii.py	(revision 3d29f26bece5e530fb2efe399f1f112d4624a5f0)
@@ -92,7 +92,10 @@
         """
         # Test .ABS file loaded as ascii
-        f = self.loader.load("ascii_test_6.txt")
+        f = None
+        try:
+            f = self.loader.load("ascii_test_6.txt")
         # The length of the data is 5
-        self.assertEqual(f, None)
+        except:
+            self.assertEqual(f, None)
         
 if __name__ == '__main__':
