Fixes issue #5 (and merge conflicts)