Fix issue #1789