Fix off by one error creating slice from value array