Fixes issue #1940

Fixes issue #1940