Fix sqrt of x'x to work for vector