Fixes #9, fixes #10, fixes #11