Improves error handling
Merge pull request #25 from andreywix/Feature-ErrorHandling

Improves error handling