Fixes issue #15 & issue #16