Fix for issue #107 and #51
Merge pull request #108 from Imaginea/issue_fix

Fix for issue #107 and #51