fixed #1018
Merge pull request #1029 from qreal/#1018

fixed #1018