Fixes #996
Merge pull request #997 from jrrideout/issue-996

Fixes #996