Fix #8
Fix issue #6
Merge pull request #9 from BrunoRamalho/master

Fix issues #6 and #8