Fixes issue #4
Fixes issue #2
Fixes issue #1