Fix a possible arithmetic error