Fix for issue #340.
Merge pull request #341 from morty/issue-340

Fix for issue #340.