fixes #11, fixes #10, fixes #9, fixes #8, fixes #2