Fix signed int bug revealed by optimization.