Fixed Issue #9
Merging changes from pull request #16

Fixes #9