Fixes #4 and a little be of issue #10.