Fixed rms calculation