Fixes #5050.