Added more error reporting
Merge pull request #1 from Xeom/master

Added more error reporting