Fixes issue #681