Add proper error reporting.