fixes #12 and fixes #8