Fix a few integer-overflow glitches