Added some error reporting, fixes #6