Fixes issue #798