Fixes #339.
Merge pull request #360 from herby/gh-339

Fixes #339.