Incoherent scatter radar autocorrelation function estimates produced by alternating codes are found to contain significant correlations between different lags and different heights. While no correlations are caused by the background thermal noise, the special structure of the alternating code sequences causes clutter or the self-noise contribution of the codes themselves to introduce maximal positive correlations between the different lag estimates. Because of this, postintegration of adjacent heights does not improve the results as much as could be expected. For a high signal-to-noise ratio, alternating code results are worse than estimates produced by similar random codes. In this paper we show that we can correct the situation by randomizing the alternating codes. This is accomplished by multiplying each alternating code sequence in the alternating code cycle by a fixed random-looking sequence. This multiplying sequence can be changed and randomly chosen at the end of each alternating code cycle. The multiplying sequence can also be kept constant with almost equally good results. If this is done, the special structure of the alternating code sequences actually causes the correlations to become less than the correlations produced by random codes. The improvement in accuracy is discussed in various situations. The reasons for the appearance of maximal positive correlations with alternating codes are explained in a mathematical appendix.