backport from pull request #3863
Merge branch 'master' into better-messages