Fixes #12, closes #13 and #11 and finally closes #5