inor fixes to rms/residual