Adds assert to protect against dividing by zero.