Fixing some edge cases in arithmetic-shift.