Issue #1621: Avoid signed overflow in list and tuple operations

Patch by Xiang Zhang.
4 files changed