Fix issue #1765