Bug fix related to signed integer overflow revealed by optimization flag.