fixed an 'integer overflow' warning from the Sun compiler. Thank to Kevin for the tip.