Fixes issue #7
Fixed issue #8