This diff is from my previous pull request #73.