Fixes #5006.