Added some error reporting.