Fixes issue #583