Fixes issue #5652