Fixes issue #1497