make cumprod and cumsum work left to right. fixes #3574