This fixes #1301.
Merge pull request #1302 from capooti/issue-1301

This fixes #1301.