Fixes #1167
Merge pull request #1202 from yurydelendik/issue1167

Fixes #1167