Fix set-cost method