Arithmetic bugfix