This fixes #12, fixes #13, fixes #14