Fixes for Issues #8 and #9

I want to contribute the fixes for issue #8 and #9