Fixes #5817 [skip ci]