Fixes issue #1091