Fixes #366
Merge pull request #415 from ddale/issue366

Fixes #366