fix for issue #41 and #42
Merge pull request #43 from cd34/master

Fix for Issue #41 and #42