Fixes issue #674