Fixes #8, fixes #7, fixes #3