Fixed issue #341 and added unit test
Merge pull request #342 from erikbern/fix-341

Fixed issue #341 and added unit test