Fix #1091
Merge pull request #1098 from sjinks/issue-1091

Fix #1091