Small angle multiple scattering of 12–40 MeV heavy ions from thin foils