Fixes issue #1771