[bug 882558] Corrected error handling
Merge pull request #16 from ksedge/bug882558

[bug 882558] Corrected error handling