Fixed bug in SampleSum -- thanks, Vladimir.