This is a fix for issue #1 and #3

Fixes #1 and #3