Fixes issue #1087.