Wakefield effects in the presence of space charge