*sz4: fixes to modified weighted sum calculation

+ associated chagnes to unit tests