Fixes issue #6916