Fixes #10, fixes #3, fixes #2