Minor changes from pull request #558