Improve error handling
Merge pull request #4 from 28msec/0.0.6

Improve error handling