diff --git a/copyright.py b/copyright.py
index 430ca6e18f7280e0653402768c34301ce6b1990a..948411930ec82725574aca929f897ce652f0e4a9 100644
--- a/copyright.py
+++ b/copyright.py
@@ -69,7 +69,10 @@ def getVersionsAndDate():
 
 
 def writeCopyrightRst(date, ltfatpy_version, ltfat_version):
-    stamp = open("copyrightstamp.txt").read()
+    stamp = ""
+    for line in open("copyrightstamp.txt"):
+        if "# COPYRIGHT #" not in line:
+            stamp += line
     stamp = stamp.replace("DATE", date)
     stamp = stamp.replace("LTFATPY_VERSION", ltfatpy_version)
     stamp = stamp.replace("LTFAT_VERSION", ltfat_version)
diff --git a/copyrightstamp.txt b/copyrightstamp.txt
index 3caeef41955c2505e65a5a45992fe660c931570b..eba801d6bf0304e8b9c22a9aa37ba431fb3de3eb 100644
--- a/copyrightstamp.txt
+++ b/copyrightstamp.txt
@@ -1,7 +1,7 @@
 ######### COPYRIGHT #########
 
 Copyright(c) DATE:
------------------
+------------------
 
 * LabEx Archimède: http://labex-archimede.univ-amu.fr/
 * Laboratoire d'Informatique Fondamentale : http://www.lif.univ-mrs.fr/
@@ -12,26 +12,26 @@ This software is a port from LTFAT LTFAT_VERSION :
 Copyright (C) 2005-DATE Peter L. Soendergaard <peter@sonderport.dk>.
 
 Contributors:
-------------
+-------------
 
 * Denis Arrivault <contact.dev_AT_lif.univ-mrs.fr>
 * Florent Jaillet <contact.dev_AT_lif.univ-mrs.fr>
 
 Description:
------------
+------------
 
 ltfatpy is a partial Python port of the Large Time/Frequency Analysis Toolbox
 (http://ltfat.sourceforge.net/), a MATLAB®/Octave toolbox for working with
 time-frequency analysis and synthesis.
 
 Version:
--------
+--------
 
 * ltfatpy version = LTFATPY_VERSION
 * LTFAT version = LTFAT_VERSION
 
 Licence:
--------
+--------
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
diff --git a/doc/conf.py b/doc/conf.py
index 7ed52a4964c8c6c928269da06001b40948afed35..f7489c8b1cfdea70ead07e0e79492d86a86eccf8 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -17,6 +17,16 @@
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 # sys.path.insert(0, os.path.abspath('.'))
+# import os
+# 
+# 
+# def get_version():
+#     versionFile = os.path.join(os.pardir, 'VERSION')
+#     v_text = open(versionFile).read().strip()
+#     v_text_formted = '{"' + v_text.replace('\n', '","').replace(':', '":"')
+#     v_text_formted += '"}'
+#     v_dict = eval(v_text_formted)
+#     return v_dict["ltfatpy"]
 
 # -- General configuration ------------------------------------------------
 
@@ -61,9 +71,10 @@ copyright = u'2015, D. Arrivault, F. Jaillet'
 # built documents.
 #
 # The short X.Y version.
-version = '1.0.0'
+import ltfatpy
+version = ltfatpy.__version__
 # The full version, including alpha/beta/rc tags.
-release = '1.0.0'
+release = version
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
@@ -138,7 +149,7 @@ html_theme = "nature"
 # Add any paths that contain custom static files (such as style sheets) here,
 # relative to this directory. They are copied after the builtin static files,
 # so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
+# html_static_path = ['_static']
 
 # Add any extra paths that contain custom files (such as robots.txt or
 # .htaccess) here, relative to this directory. These files are copied
diff --git a/doc/copyright.rst b/doc/copyright.rst
index 1dff262b7926dd5c09fb83a4ad11d92ba814cea2..ba7cb0b3e030ec4c352768c3d1656ea8db681f49 100644
--- a/doc/copyright.rst
+++ b/doc/copyright.rst
@@ -1,7 +1,6 @@
-######### COPYRIGHT #########
 
 Copyright(c) 2016:
------------------
+------------------
 
 * LabEx Archimède: http://labex-archimede.univ-amu.fr/
 * Laboratoire d'Informatique Fondamentale : http://www.lif.univ-mrs.fr/
@@ -12,26 +11,26 @@ This software is a port from LTFAT 2.1.0 :
 Copyright (C) 2005-2016 Peter L. Soendergaard <peter@sonderport.dk>.
 
 Contributors:
-------------
+-------------
 
 * Denis Arrivault <contact.dev_AT_lif.univ-mrs.fr>
 * Florent Jaillet <contact.dev_AT_lif.univ-mrs.fr>
 
 Description:
------------
+------------
 
 ltfatpy is a partial Python port of the Large Time/Frequency Analysis Toolbox
 (http://ltfat.sourceforge.net/), a MATLAB®/Octave toolbox for working with
 time-frequency analysis and synthesis.
 
 Version:
--------
+--------
 
 * ltfatpy version = 1.0.4
 * LTFAT version = 2.1.0
 
 Licence:
--------
+--------
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -46,4 +45,3 @@ GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-######### COPYRIGHT #########
\ No newline at end of file
diff --git a/doc/install.rst b/doc/install.rst
index 4a13cb67e9fad61e900c62153f706ea06ab06ea4..2ea351563810d769265586e78bebc38ecafe9dd7 100644
--- a/doc/install.rst
+++ b/doc/install.rst
@@ -60,3 +60,5 @@ Before building documentation you have to install **sphinxcontrib-bibtex** :
 
 Then you have to use the setup.py build_sphinx command :
 ``python setup.py build_sphinx``
+
+If errors occur, make sure you installed ltfatpy before building the sphinx documentation.
diff --git a/ltfatpy/__init__.py b/ltfatpy/__init__.py
index 31c06e909d95e2f857a20631859b71c8ae2f74c5..413ffd2dc8be3ce791eb79fad765efd64c380b26 100644
--- a/ltfatpy/__init__.py
+++ b/ltfatpy/__init__.py
@@ -117,4 +117,4 @@ __all__ = ["arg_firwin", "assert_groworder", "assert_sigreshape_post",
            "long2fir", "normalize", "rms", "thresh", "lcm", "postpad"]
 
 
-__version__ = "1.0.3"
+__version__ = "1.0.4"
diff --git a/ltfatpy/fourier/dcti.py b/ltfatpy/fourier/dcti.py
index d60ee8a045099a4271a32cc066e5a072e59607d1..39507f6758d603b000061160cf67cf83135a283c 100644
--- a/ltfatpy/fourier/dcti.py
+++ b/ltfatpy/fourier/dcti.py
@@ -118,6 +118,6 @@ def dcti(f, L=None, dim=None):
         c = comp_dct(f, 1)
     return assert_sigreshape_post(c, dim, permutedsize, order)
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/fourier/dctii.py b/ltfatpy/fourier/dctii.py
index f847aacd261c28c65a05d2d98e15bb27a02ed298..62e341f2a94150cad2d58e2f7565bac1f3cb5eff 100644
--- a/ltfatpy/fourier/dctii.py
+++ b/ltfatpy/fourier/dctii.py
@@ -116,6 +116,6 @@ def dctii(f, L=None, dim=None):
 
     return assert_sigreshape_post(c, dim, permutedsize, order)
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/fourier/dctiii.py b/ltfatpy/fourier/dctiii.py
index dda3fedf1421864611c372aa9fdb25235cb300b1..462da06b75f9ba6b36bb45bb420b31597f4a7d0f 100644
--- a/ltfatpy/fourier/dctiii.py
+++ b/ltfatpy/fourier/dctiii.py
@@ -110,6 +110,6 @@ def dctiii(f, L=None, dim=None):
         c = comp_dct(f, 3)
     return assert_sigreshape_post(c, dim, permutedsize, order)
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/fourier/dctiv.py b/ltfatpy/fourier/dctiv.py
index 2bc6d9648989f5d4e0b1babd4475536f96e02934..cc02fb2a40bf33e88cb61b7a88e8d7a327f7f5d4 100644
--- a/ltfatpy/fourier/dctiv.py
+++ b/ltfatpy/fourier/dctiv.py
@@ -98,6 +98,6 @@ def dctiv(f, L=None, dim=None):
         c = comp_dct(f, 4)
     return assert_sigreshape_post(c, dim, permutedsize, order)
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/fourier/dsti.py b/ltfatpy/fourier/dsti.py
index e8aefb7fd707fa6012e80c08794b7485cdbfa81e..c3466ef9d106bd6c4cb826be7813896aa0481a7f 100644
--- a/ltfatpy/fourier/dsti.py
+++ b/ltfatpy/fourier/dsti.py
@@ -105,6 +105,6 @@ def dsti(f, L=None, dim=None):
         c = comp_dst(f, 1)
     return assert_sigreshape_post(c, dim, permutedsize, order)
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/fourier/dstii.py b/ltfatpy/fourier/dstii.py
index 13c32b499b6c9eab9086271c2fa1ff72a7983cab..c6945bd9541b877e386a392d04dac1dd7990097e 100644
--- a/ltfatpy/fourier/dstii.py
+++ b/ltfatpy/fourier/dstii.py
@@ -108,6 +108,6 @@ def dstii(f, L=None, dim=None):
         c = comp_dst(f, 2)
     return assert_sigreshape_post(c, dim, permutedsize, order)
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/fourier/dstiii.py b/ltfatpy/fourier/dstiii.py
index 85987704cc696c4a4d91077430e8e9486296b3bb..e613fd63cd3c307ebf8aa760687f35596e26c5e5 100644
--- a/ltfatpy/fourier/dstiii.py
+++ b/ltfatpy/fourier/dstiii.py
@@ -108,6 +108,6 @@ def dstiii(f, L=None, dim=None):
         c = comp_dst(f, 3)
     return assert_sigreshape_post(c, dim, permutedsize, order)
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/fourier/dstiv.py b/ltfatpy/fourier/dstiv.py
index 30c9c4147d3da15ff7880b64abeb4667de5603df..35ebc3bb23484709decbdadb9528c5b64f806771 100644
--- a/ltfatpy/fourier/dstiv.py
+++ b/ltfatpy/fourier/dstiv.py
@@ -99,6 +99,6 @@ def dstiv(f, L=None, dim=None):
         c = comp_dst(f, 4)
     return assert_sigreshape_post(c, dim, permutedsize, order)
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/fourier/pgauss.py b/ltfatpy/fourier/pgauss.py
index 380850533551696d807869210a218311617fafd0..18f8fada4c3e57b5687a7b6b733e4d24aeb03e43 100644
--- a/ltfatpy/fourier/pgauss.py
+++ b/ltfatpy/fourier/pgauss.py
@@ -145,6 +145,6 @@ def pgauss(L, tfr=1.0, fs=0.0, width=0.0, bw=0.0, c_f=0.0, centering='wp',
     g = normalize(g, norm)[0]
     return(g, tfr)
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/fourier/pherm.py b/ltfatpy/fourier/pherm.py
index 96a1eb2afe1d037e5e1c91086a458cfb1004fa18..047839a57ecb5051ed16e047589af2e0a4ccf5f7 100644
--- a/ltfatpy/fourier/pherm.py
+++ b/ltfatpy/fourier/pherm.py
@@ -217,6 +217,6 @@ def get_safe(order):
                     safe = 12
     return safe
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/fourier/psech.py b/ltfatpy/fourier/psech.py
index b7aa102378a4642e0beb64c8544e3b4f47e9349f..d142bc5e87b7def263d14a50c6b379ff86dd0fdc 100644
--- a/ltfatpy/fourier/psech.py
+++ b/ltfatpy/fourier/psech.py
@@ -106,6 +106,6 @@ def psech(L, tfr=None, s=None, **kwargs):
     g = g * np.sqrt(np.pi / (2 * np.sqrt(L*w)))
     return(g, tfr)
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/gabor/dgt.py b/ltfatpy/gabor/dgt.py
index 76713e2b06bb55150219483a55e959b71a62b6a2..aa4f5379514a824ee8bf5e005203f4cadafbc1d0 100644
--- a/ltfatpy/gabor/dgt.py
+++ b/ltfatpy/gabor/dgt.py
@@ -192,6 +192,6 @@ def dgt(f, g, a, M, L=None, pt='freqinv'):
 
     return (c, Ls, gnum)
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/gabor/dgtreal.py b/ltfatpy/gabor/dgtreal.py
index a6854f28055194ac47971f58925a8206f499beda..89cf359c889ddd0f9f37c75a0f72c8df30a0adb2 100644
--- a/ltfatpy/gabor/dgtreal.py
+++ b/ltfatpy/gabor/dgtreal.py
@@ -137,6 +137,6 @@ def dgtreal(f, g, a, M, L=None, pt='freqinv'):
     return (c, Ls, gnum)
 
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/gabor/gabdual.py b/ltfatpy/gabor/gabdual.py
index 7b3ca833ca0882206361c09c1567c3ed325a0884..91be1a7c08a6147d63b4bc78659ba2e9c7e25672 100644
--- a/ltfatpy/gabor/gabdual.py
+++ b/ltfatpy/gabor/gabdual.py
@@ -140,6 +140,6 @@ def _call_gabwin(g, a, M, L):
     return gabwin(g, a, M, L)
 
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/gabor/gabimagepars.py b/ltfatpy/gabor/gabimagepars.py
index c187824272c32b78a1501db4f9b2741f1d252a5c..6bedf19bb2f2adc0f31c7b56e9f56fa10c956995 100644
--- a/ltfatpy/gabor/gabimagepars.py
+++ b/ltfatpy/gabor/gabimagepars.py
@@ -127,6 +127,6 @@ def gabimagepars(Ls, x, y):
     return (a, M, L, N, Ngood)
 
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/gabor/gabtight.py b/ltfatpy/gabor/gabtight.py
index 23cb192fc3598ae669986b428ae1e868ee0c2ae2..5f44e9c4692e010e3f8d8b80a60f80c4d5db5f09 100644
--- a/ltfatpy/gabor/gabtight.py
+++ b/ltfatpy/gabor/gabtight.py
@@ -148,6 +148,6 @@ def _call_gabwin(g, a, M, L):
     from ltfatpy.gabor.gabwin import gabwin
     return gabwin(g, a, M, L)
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/gabor/idgt.py b/ltfatpy/gabor/idgt.py
index 19a49eff999b1e666f1c761a40a9df89f4e5c0ed..1a224717751aa1685038ca0eb79f61812ed5e015 100644
--- a/ltfatpy/gabor/idgt.py
+++ b/ltfatpy/gabor/idgt.py
@@ -150,6 +150,6 @@ def idgt(coef, g, a, Ls=None, pt='freqinv'):
     f = comp_sigreshape_post(f, Ls, 0, (0, W))
     return (f, gnum)
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/gabor/idgtreal.py b/ltfatpy/gabor/idgtreal.py
index b88e62450ddbd4dd05a2b2946a53b9a17ef5bfc1..7eff9b5a7829cea79b1001433ace77ee461a4b75 100644
--- a/ltfatpy/gabor/idgtreal.py
+++ b/ltfatpy/gabor/idgtreal.py
@@ -170,6 +170,6 @@ def idgtreal(coef, g, a, M, Ls=None, pt='freqinv'):
     f = comp_sigreshape_post(f, Ls, 0, (0, W))
     return (f, g)
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/gabor/instfreqplot.py b/ltfatpy/gabor/instfreqplot.py
index 645de31d616d35ee00df981b0a9b6ee35fdf7a9a..8e80eb7945e31a1d5381948f3337cb5b5a879d21 100644
--- a/ltfatpy/gabor/instfreqplot.py
+++ b/ltfatpy/gabor/instfreqplot.py
@@ -168,6 +168,6 @@ def instfreqplot(f, fs=None, tfr=1., wlen=None, nf=None, thr=None, fmax=None,
     return coef
 
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/gabor/phaseplot.py b/ltfatpy/gabor/phaseplot.py
index 6d2e0c8e119811245a90765567aea9b5d0518291..4941b1e1145037218042bf62910d15f2acee2e08 100644
--- a/ltfatpy/gabor/phaseplot.py
+++ b/ltfatpy/gabor/phaseplot.py
@@ -161,6 +161,6 @@ def phaseplot(f, fs=None, tfr=1., wlen=None, nf=None, thr=None, fmax=None,
     return coef
 
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/gabor/sgram.py b/ltfatpy/gabor/sgram.py
index 4592475ca9d6611648b557ec6464fa62916ef62e..8e937935b1193a9d2ccaf42ccdb5342ebe7a73ef 100644
--- a/ltfatpy/gabor/sgram.py
+++ b/ltfatpy/gabor/sgram.py
@@ -177,6 +177,6 @@ def sgram(f, fs=None, tfr=1., wlen=None, nf=None, thr=None, fmax=None,
 
     return coef
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/signals/greasy.py b/ltfatpy/signals/greasy.py
index 8aba8a5ec42e55d7e954a5afcc9e0531f89cd6b4..6e48fd6e36ac13e6ac3c34c656c440e8d6334bfc 100644
--- a/ltfatpy/signals/greasy.py
+++ b/ltfatpy/signals/greasy.py
@@ -82,6 +82,6 @@ def greasy():
     s = s.astype(np.float64) / 2.**15.
     return (s, fs)
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()
diff --git a/ltfatpy/sigproc/firwin.py b/ltfatpy/sigproc/firwin.py
index 75be9e9b4b6ac352ef1738bff4dfa33256a83153..1775585347cb1b74904090adfc397391e5304922 100644
--- a/ltfatpy/sigproc/firwin.py
+++ b/ltfatpy/sigproc/firwin.py
@@ -333,7 +333,7 @@ def firwin(name, M=0, x=None, **kwargs):
 
     return (g, info)
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     (g, info) = firwin(name='sine', M=18, centering='wp')
     print(g)
     print(info)
diff --git a/ltfatpy/sigproc/thresh.py b/ltfatpy/sigproc/thresh.py
index 97324a2c57fe80902d6dba642daa9fd83c9e5f9e..290d5a3fab7257424598d67eae192881ce1245b7 100644
--- a/ltfatpy/sigproc/thresh.py
+++ b/ltfatpy/sigproc/thresh.py
@@ -144,6 +144,6 @@ def thresh(xi, lamb, thresh_type='hard'):
 
     return (xo, N)
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     import doctest
     doctest.testmod()