fixing small bugs in prod, cumsum, cumprod