Fix for github issue #2160