Added extra checks to dbFixIntegrity