Fixes #8012

Fixes issue #8012