Fixes #4926
Merge pull request #5831