Fixes issue #1366