Fix calc-avg-rate for lower # of samples

Assumed >= 3, but when fewer it was erroring.