Tests are again reweighted with length(x1), not sum(w1). This is the right thing to do according to Root KS test