Fixes issue #11 + some clean-up