Fixes #5866. Issue number in previous commit was wrong both in comments and commit...