Fix rms calc