Improved error reporting

Improved error reporting, see Issue #7