Screening effects in optical isotope shifts in Ce IV, Sn IV and Cd II