Fixes #13 and #8