Fixes #1 and fixes #3