Fix SQLITE_ERROR exceptions seen in the log when generating reports.