Fixing error throwing
Merge pull request #64 from vladikoff/error-throw

Fixing error throwing