Simplify implementation of centralize_sumabs2

Also fix a bounds violation when computing the variance of a vector
with a single element