Fixes GH issue #13
Fixes GH issue #9 and issue #14