fixed a small bug in the quadratic mean calculation