It has been discovered that metals and / or amines can be removed or transferred from a hydrocarbon phase to a water phase in an emulsion breaking process by using a composition that contains water-soluble hydroxyacids. Suitable water-soluble hydroxyacids include, but are not necessarily limited to glycolic acid, gluconic acid, C2-C4 alpha-hydroxy acids, poly-hydroxy carboxylic acids, thioglycolic acid, chloroacetic acid, polymeric forms of the above hydroxyacids, poly-glycolic esters, glycolate ethers, and ammonium salt and alkali metal salts of these hydroxyacids, and mixtures thereof. The composition may also include at least one mineral acid to reduce the pH of the desalter wash water. A solvent may be optionally included in the composition. The invention permits transfer of metals and / or amines into the aqueous phase with little or no hydrocarbon phase undercarry into the aqueous phase. The composition is particularly useful in treating crude oil emulsions, and in removing calcium and other metals therefrom.