Fixes #6518 [skip ci]