Improve error handling
Merge pull request #5 from 28msec/0.0.7

Improve error handling