Accurate ion beam analysis in the presence of surface roughness