Fixes for issue #10, issue #13 and issue #15
Merge pull request #16 from GotoLink/master

Fixes for issue #10, issue #13 and issue #15