Fix signs in calculate()