Prevention or removal of corrosion or solid deposits