Fix off by one errors on cinsumergroup library and tests