Fix wRMSD

Now the code can run successfully.