See commit messages for details - issue 11