Fix some arithmetical errors.