Fixes #11 and fixes #12