See individual commit messages, working on issues #60, #75, #1