Fix for github issue #1947