Merge pull request #4 from pboado/master

Fixes for issues #1, #2 & #3
Thank you very much pboado!