Fixes from pull request #1643