Fixes issue #2 and #3
Fixed #1