fix sum squares for missing values