Fix issue 1580
Merge pull request #1716 from zmzhuai/master

Fix issue 1580