Fixes #3 and fixes #7