Fixes #1, fixes #11, fixes #12.