Preventing corrosion or unwanted deposits in gas-swept spaces