Merge pull request #5 from gidouin/master

Proposed fix for 2 issues