Fixes issue #376