Fixed issue #1689
Merge pull request #1695 from umpirsky/fix/issue-1689-a

Fixed issue #1689