Added error reporting.