Partial fix for issue 46
Merge pull request #47 from Daytron/hotfix/issue-26-and-33

Partial fix for issue 46