Fix bugs. Do not throw exception when the database becomes inconsistent.