Corrupted database checks--, some cleanups