Fixes #11, fixes #12, fixes #13, fixes #15