Fixed error reporting: #1.
Merge pull request #2 from mittsh/fix-error-reporting

Fixed error reporting