fixes #15 and fixes #12