Fixes #1 and fixes #4