Fixes issue #519