Integrate pull request #294 into #618.