Bug fix to issue #1697