Fixes #4926
Merge pull request #5831
Merge pull request #5831 in master