Fixed potentially confusing arithmetic as warned by gcc