*agent: fixes to modified weighted sum calculation

+ associated chagnes to unit tests