Added more error logging to help troubleshoot Sqlite3 errors.