The two main reasons that RDKit cannot sanitize the SMILES are 1) failure to kekularize aromatic rings and 2) improper valences such as a N atom with four bonds lacking a positive charge. The kekularization error always involves at least one ligand atom covalently bonded to the metal (the CSD SMILES do not contain dative ligand-metal bonds), while this is not necessarily the case for atoms with improper valences. The cleanup process involves the conversion of all ligand-metal bonds to dative bonds. If the bond is judged to be a "true" covalent bond, based on its valency, then the charge on the metal and the ligand atom is increased and decreased, respectively, according to the bond order. For example, if the bond order is one, then the charge of the metal atom and ligand atom is increased and decreased by one unit, respectively. Occasionally, the CSD SMILES string does not contain the explicit hydrogen atoms commensurate with the bonding type, leading to a wrong assignment of atomic charges. However, these errors are typically caught (though not corrected) since such errors will lead to the wrong number of implicit hydrogen atoms being added in the sanitation step, which in turn, leads to the wrong empirical formula of the compound. Atoms with incorrect valencies (typically N and B atoms) that are not directly bonded to the metal have formal charges assigned in a similar way. A +1 charge is assigned to hypervalent N atoms while the charge of the metal is decreased by one unit, while the opposite is true for hypervalent B atoms. In addition, SMARTS-based fixes are done for special cases like carbenes, carbon monoxide, metal triple bonds to O and N atoms, and pyrrole.